summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rwxr-xr-xindra/CMakeLists.txt8
-rwxr-xr-xindra/cmake/00-Common.cmake25
-rwxr-xr-xindra/cmake/Audio.cmake2
-rwxr-xr-xindra/cmake/BerkeleyDB.cmake2
-rw-r--r--indra/cmake/BuildPackagesInfo.cmake10
-rwxr-xr-xindra/cmake/CMakeLists.txt14
-rwxr-xr-xindra/cmake/DBusGlib.cmake2
-rwxr-xr-xindra/cmake/FindAutobuild.cmake36
-rw-r--r--indra/cmake/GLEXT.cmake6
-rwxr-xr-xindra/cmake/GLH.cmake2
-rwxr-xr-xindra/cmake/GLOD.cmake2
-rwxr-xr-xindra/cmake/GoogleMock.cmake10
-rwxr-xr-xindra/cmake/Havok.cmake14
-rwxr-xr-xindra/cmake/JsonCpp.cmake6
-rw-r--r--indra/cmake/LLAddBuildTest.cmake4
-rw-r--r--indra/cmake/LLAppearanceUtility.cmake2
-rwxr-xr-xindra/cmake/LLSharedLibs.cmake2
-rwxr-xr-xindra/cmake/Linking.cmake2
-rwxr-xr-xindra/cmake/NDOF.cmake6
-rwxr-xr-xindra/cmake/OPENAL.cmake6
-rwxr-xr-xindra/cmake/Prebuilt.cmake26
-rwxr-xr-xindra/cmake/QuickTimePlugin.cmake4
-rwxr-xr-xindra/cmake/UI.cmake5
-rwxr-xr-xindra/cmake/Variables.cmake54
-rwxr-xr-xindra/cmake/ViewerMiscLibs.cmake6
-rwxr-xr-xindra/cmake/XmlRpcEpi.cmake2
-rwxr-xr-xindra/cmake/run_build_test.py19
-rwxr-xr-xindra/llappearance/llavatarappearance.cpp38
-rwxr-xr-xindra/llappearance/llavatarappearance.h8
-rw-r--r--indra/llappearance/llpolymorph.h10
-rw-r--r--indra/llappearance/llpolyskeletaldistortion.cpp2
-rw-r--r--indra/llappearance/llpolyskeletaldistortion.h13
-rw-r--r--indra/llappearance/lltexturemanagerbridge.h2
-rwxr-xr-xindra/llappearance/llwearable.h6
-rwxr-xr-xindra/llappearance/llwearabledata.cpp5
-rw-r--r--indra/llappearance/llwearabletype.h3
-rwxr-xr-xindra/llaudio/CMakeLists.txt1
-rwxr-xr-xindra/llaudio/llaudiodecodemgr.cpp11
-rwxr-xr-xindra/llcharacter/lleditingmotion.cpp2
-rwxr-xr-xindra/llcharacter/llheadrotmotion.cpp3
-rwxr-xr-xindra/llcharacter/lljoint.cpp190
-rwxr-xr-xindra/llcharacter/lljoint.h40
-rwxr-xr-xindra/llcharacter/llkeyframemotion.cpp4
-rwxr-xr-xindra/llcharacter/llkeyframewalkmotion.cpp3
-rwxr-xr-xindra/llcharacter/lltargetingmotion.cpp3
-rwxr-xr-xindra/llcommon/CMakeLists.txt2
-rwxr-xr-xindra/llcommon/llerror.cpp2
-rwxr-xr-xindra/llcommon/lleventcoro.h8
-rwxr-xr-xindra/llcommon/llfile.cpp2
-rwxr-xr-xindra/llcommon/llfile.h2
-rwxr-xr-xindra/llcommon/llframetimer.cpp1
-rwxr-xr-xindra/llcommon/llhash.h43
-rwxr-xr-xindra/llcommon/llinitparam.h12
-rw-r--r--indra/llcommon/llpredicate.h4
-rwxr-xr-xindra/llcommon/llpreprocessor.h5
-rwxr-xr-xindra/llcommon/llprocessor.cpp17
-rwxr-xr-xindra/llcommon/llrefcount.h36
-rwxr-xr-xindra/llcommon/llsd.cpp5
-rwxr-xr-xindra/llcommon/llsdparam.h1
-rwxr-xr-xindra/llcommon/llsdutil.cpp2
-rwxr-xr-xindra/llcommon/llsdutil.h2
-rwxr-xr-xindra/llcommon/llstring.cpp2
-rwxr-xr-xindra/llcommon/llsys.cpp5
-rwxr-xr-xindra/llcommon/llthread.cpp18
-rw-r--r--indra/llcommon/llthreadlocalstorage.h41
-rwxr-xr-xindra/llcommon/lltimer.cpp4
-rw-r--r--indra/llcommon/lltraceaccumulators.h18
-rw-r--r--indra/llcommon/llunittype.h92
-rwxr-xr-xindra/llcommon/stringize.h6
-rwxr-xr-xindra/llcommon/tests/lldependencies_test.cpp46
-rwxr-xr-xindra/llcommon/tests/llerror_test.cpp30
-rwxr-xr-xindra/llcommon/tests/lleventcoro_test.cpp1
-rwxr-xr-xindra/llcommon/tests/llframetimer_test.cpp33
-rwxr-xr-xindra/llcommon/tests/llleap_test.cpp27
-rwxr-xr-xindra/llcommon/tests/llprocess_test.cpp6
-rwxr-xr-xindra/llcommon/tests/llsdserialize_test.cpp41
-rwxr-xr-xindra/llcommon/tests/llstring_test.cpp4
-rwxr-xr-xindra/llcorehttp/_httpoprequest.cpp47
-rwxr-xr-xindra/llcorehttp/bufferstream.cpp2
-rwxr-xr-xindra/llcorehttp/examples/http_texture_load.cpp4
-rwxr-xr-xindra/llimage/llimage.cpp16
-rwxr-xr-xindra/llimage/llimagefilter.cpp2
-rwxr-xr-xindra/llkdu/llimagej2ckdu.h10
-rwxr-xr-xindra/llkdu/llkdumem.h10
-rwxr-xr-xindra/llkdu/tests/llimagej2ckdu_test.cpp23
-rwxr-xr-xindra/llmath/llline.cpp1
-rwxr-xr-xindra/llmath/llmath.h36
-rwxr-xr-xindra/llmath/lloctree.h16
-rwxr-xr-xindra/llmath/llquantize.h4
-rwxr-xr-xindra/llmath/llquaternion.h18
-rwxr-xr-xindra/llmath/llvolume.cpp14
-rwxr-xr-xindra/llmath/tests/llquaternion_test.cpp4
-rwxr-xr-xindra/llmath/tests/mathmisc_test.cpp24
-rwxr-xr-xindra/llmath/tests/v4coloru_test.cpp8
-rwxr-xr-xindra/llmath/v4color.cpp8
-rwxr-xr-xindra/llmath/v4coloru.h22
-rwxr-xr-xindra/llmessage/llcachename.cpp3
-rwxr-xr-xindra/llmessage/llcircuit.cpp2
-rwxr-xr-xindra/llmessage/llhttpassetstorage.cpp3
-rwxr-xr-xindra/llmessage/lliopipe.h72
-rwxr-xr-xindra/llmessage/llpartdata.cpp5
-rwxr-xr-xindra/llmessage/llregionhandle.h4
-rwxr-xr-xindra/llmessage/llthrottle.cpp2
-rwxr-xr-xindra/llmessage/llxfermanager.cpp2
-rwxr-xr-xindra/llmessage/message.cpp2
-rwxr-xr-xindra/llmessage/tests/llhost_test.cpp30
-rwxr-xr-xindra/llplugin/CMakeLists.txt2
-rwxr-xr-xindra/llplugin/llpluginclassmedia.cpp2
-rwxr-xr-xindra/llplugin/slplugin/slplugin-objc.h2
-rw-r--r--indra/llprimitive/llmaterial.cpp20
-rwxr-xr-xindra/llprimitive/llmodel.cpp20
-rwxr-xr-xindra/llprimitive/llprimitive.cpp20
-rwxr-xr-xindra/llprimitive/llvolumemessage.cpp64
-rwxr-xr-xindra/llrender/CMakeLists.txt1
-rwxr-xr-xindra/llrender/llfontfreetype.cpp5
-rwxr-xr-xindra/llrender/llfontfreetype.h2
-rwxr-xr-xindra/llrender/llfontgl.cpp38
-rwxr-xr-xindra/llrender/llglslshader.cpp2066
-rwxr-xr-xindra/llrender/llpostprocess.cpp9
-rwxr-xr-xindra/llrender/llrender.cpp2
-rw-r--r--indra/llrender/llrender2dutils.cpp16
-rwxr-xr-xindra/llrender/llshadermgr.cpp13
-rw-r--r--indra/llrender/lluiimage.cpp4
-rwxr-xr-xindra/llrender/llvertexbuffer.cpp6
-rwxr-xr-xindra/llui/llaccordionctrl.cpp10
-rwxr-xr-xindra/llui/llbadge.cpp8
-rwxr-xr-xindra/llui/llbutton.cpp8
-rwxr-xr-xindra/llui/llcheckboxctrl.cpp2
-rwxr-xr-xindra/llui/llconsole.cpp1
-rwxr-xr-xindra/llui/lldraghandle.cpp1
-rwxr-xr-xindra/llui/llfloater.cpp30
-rwxr-xr-xindra/llui/llfocusmgr.h2
-rwxr-xr-xindra/llui/llfolderview.cpp9
-rw-r--r--indra/llui/llfolderviewitem.cpp35
-rwxr-xr-xindra/llui/llfolderviewmodel.h26
-rwxr-xr-xindra/llui/llkeywords.cpp8
-rwxr-xr-xindra/llui/lllayoutstack.cpp22
-rwxr-xr-xindra/llui/lllineeditor.cpp20
-rwxr-xr-xindra/llui/llmenugl.cpp28
-rwxr-xr-xindra/llui/llmodaldialog.cpp2
-rwxr-xr-xindra/llui/llprogressbar.cpp2
-rwxr-xr-xindra/llui/llrngwriter.cpp9
-rwxr-xr-xindra/llui/llscrollcontainer.cpp3
-rwxr-xr-xindra/llui/llscrolllistctrl.cpp7
-rwxr-xr-xindra/llui/llsliderctrl.cpp2
-rwxr-xr-xindra/llui/llspinctrl.cpp2
-rwxr-xr-xindra/llui/llstatbar.cpp4
-rwxr-xr-xindra/llui/llstatbar.h1
-rwxr-xr-xindra/llui/llstatgraph.cpp2
-rwxr-xr-xindra/llui/lltextbase.cpp6
-rwxr-xr-xindra/llui/lltexteditor.cpp2
-rwxr-xr-xindra/llui/lltextvalidate.cpp2
-rwxr-xr-xindra/llui/lltimectrl.cpp7
-rwxr-xr-xindra/llui/llui.cpp16
-rwxr-xr-xindra/llui/lluictrlfactory.h8
-rwxr-xr-xindra/llui/llurlentry.cpp12
-rwxr-xr-xindra/llui/llurlentry.h2
-rwxr-xr-xindra/llui/llurlregistry.cpp20
-rwxr-xr-xindra/llui/llurlregistry.h2
-rwxr-xr-xindra/llui/llview.cpp6
-rwxr-xr-xindra/llui/llxuiparser.cpp2
-rwxr-xr-xindra/llvfs/lldiriterator.cpp3
-rwxr-xr-xindra/llvfs/llvfs_objc.h2
-rwxr-xr-xindra/llvfs/llvfs_objc.mm2
-rw-r--r--indra/llwindow/llopenglview-objc.h1
-rw-r--r--indra/llwindow/llopenglview-objc.mm203
-rwxr-xr-xindra/llwindow/llwindowmacosx-objc.h2
-rwxr-xr-xindra/llwindow/llwindowmacosx.cpp66
-rwxr-xr-xindra/llxml/llxmlnode.cpp2
-rwxr-xr-xindra/lscript/lscript_execute/lscript_readlso.cpp2
-rwxr-xr-xindra/media_plugins/example/media_plugin_example.cpp4
-rwxr-xr-xindra/media_plugins/winmmshim/forwarding_api.cpp4
-rwxr-xr-xindra/media_plugins/winmmshim/forwarding_api.h4
-rwxr-xr-xindra/newview/CMakeLists.txt96
-rw-r--r--indra/newview/VIEWER_VERSION.txt2
-rwxr-xr-xindra/newview/app_settings/settings.xml24
-rwxr-xr-xindra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl6
-rwxr-xr-xindra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl9
-rwxr-xr-xindra/newview/app_settings/shaders/class1/deferred/alphaV.glsl5
-rwxr-xr-xindra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl6
-rwxr-xr-xindra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl8
-rwxr-xr-xindra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl22
-rwxr-xr-xindra/newview/app_settings/shaders/class1/deferred/postgiF.glsl6
-rwxr-xr-xindra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl25
-rwxr-xr-xindra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl26
-rwxr-xr-xindra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl25
-rwxr-xr-xindra/newview/generate_breakpad_symbols.py3
-rwxr-xr-xindra/newview/llagent.cpp23
-rwxr-xr-xindra/newview/llagent.h3
-rwxr-xr-xindra/newview/llagentcamera.cpp2
-rwxr-xr-xindra/newview/llagentwearables.cpp31
-rwxr-xr-xindra/newview/llagentwearables.h5
-rwxr-xr-xindra/newview/llaisapi.cpp1
-rwxr-xr-x[-rw-r--r--]indra/newview/llappdelegate-objc.mm10
-rwxr-xr-xindra/newview/llappearancemgr.cpp90
-rwxr-xr-xindra/newview/llappviewer.cpp43
-rwxr-xr-xindra/newview/llappviewermacosx.cpp11
-rwxr-xr-xindra/newview/llassetuploadresponders.cpp3
-rwxr-xr-xindra/newview/llblocklist.cpp1
-rwxr-xr-xindra/newview/llblocklist.h1
-rwxr-xr-xindra/newview/llchicletbar.cpp10
-rwxr-xr-xindra/newview/llcommunicationchannel.cpp6
-rw-r--r--indra/newview/llconversationmodel.h1
-rwxr-xr-xindra/newview/lldrawable.cpp3
-rwxr-xr-xindra/newview/lldrawpool.cpp2
-rwxr-xr-xindra/newview/lldrawpool.h2
-rwxr-xr-xindra/newview/lldrawpoolavatar.cpp7
-rwxr-xr-xindra/newview/lldrawpoolbump.cpp4
-rw-r--r--indra/newview/lldrawpoolmaterials.cpp2
-rwxr-xr-xindra/newview/llfasttimerview.cpp13
-rwxr-xr-xindra/newview/llfeaturemanager.cpp223
-rwxr-xr-xindra/newview/llfeaturemanager.h3
-rwxr-xr-xindra/newview/llfilepicker.cpp21
-rwxr-xr-xindra/newview/llfilepicker.h2
-rwxr-xr-xindra/newview/llflexibleobject.cpp2
-rw-r--r--indra/newview/llflickrconnect.cpp2
-rwxr-xr-xindra/newview/llfloaterabout.cpp56
-rwxr-xr-xindra/newview/llfloaterbuyland.cpp7
-rwxr-xr-xindra/newview/llfloatercamera.cpp4
-rw-r--r--indra/newview/llfloaterfacebook.cpp1
-rw-r--r--indra/newview/llfloaterflickr.cpp1
-rwxr-xr-xindra/newview/llfloatergodtools.cpp8
-rw-r--r--indra/newview/llfloatergroupbulkban.cpp2
-rwxr-xr-xindra/newview/llfloaterimsession.cpp4
-rwxr-xr-xindra/newview/llfloaterimsessiontab.cpp2
-rwxr-xr-xindra/newview/llfloaterland.cpp8
-rwxr-xr-xindra/newview/llfloaterlandholdings.cpp4
-rwxr-xr-xindra/newview/llfloatermap.cpp9
-rwxr-xr-xindra/newview/llfloatermediasettings.cpp1
-rwxr-xr-xindra/newview/llfloatermediasettings.h1
-rwxr-xr-xindra/newview/llfloatermodelpreview.cpp16
-rwxr-xr-xindra/newview/llfloaternamedesc.cpp5
-rwxr-xr-xindra/newview/llfloateropenobject.cpp23
-rwxr-xr-xindra/newview/llfloateropenobject.h7
-rwxr-xr-xindra/newview/llfloaterpathfindingcharacters.cpp2
-rwxr-xr-xindra/newview/llfloaterpathfindingobjects.cpp2
-rwxr-xr-xindra/newview/llfloaterpay.cpp76
-rwxr-xr-xindra/newview/llfloaterpreference.cpp8
-rwxr-xr-xindra/newview/llfloaterreporter.cpp2
-rwxr-xr-xindra/newview/llfloaterscriptlimits.h26
-rwxr-xr-xindra/newview/llfloatersnapshot.cpp4
-rwxr-xr-xindra/newview/llfloatertos.cpp1
-rwxr-xr-xindra/newview/llfloatertos.h1
-rw-r--r--indra/newview/llfloatertwitter.cpp1
-rwxr-xr-xindra/newview/llfloateruipreview.cpp1
-rwxr-xr-xindra/newview/llfloaterwebcontent.cpp7
-rwxr-xr-xindra/newview/llfloaterworldmap.cpp6
-rwxr-xr-xindra/newview/llfolderviewmodelinventory.cpp12
-rwxr-xr-xindra/newview/llglsandbox.cpp60
-rwxr-xr-xindra/newview/llgrouplist.cpp2
-rwxr-xr-xindra/newview/llhudeffecttrail.cpp7
-rwxr-xr-xindra/newview/llhudnametag.cpp7
-rwxr-xr-xindra/newview/llhudtext.cpp12
-rwxr-xr-xindra/newview/llhudview.cpp4
-rwxr-xr-xindra/newview/llinventorybridge.cpp84
-rwxr-xr-xindra/newview/llinventorybridge.h3
-rwxr-xr-xindra/newview/llinventoryfilter.cpp24
-rwxr-xr-xindra/newview/llinventorypanel.cpp29
-rwxr-xr-xindra/newview/lllandmarkactions.cpp10
-rwxr-xr-xindra/newview/lllocalbitmaps.cpp1
-rwxr-xr-xindra/newview/lllogchat.cpp2
-rwxr-xr-xindra/newview/lllogininstance.cpp24
-rwxr-xr-xindra/newview/lllogininstance.h1
-rwxr-xr-xindra/newview/llmanip.cpp4
-rwxr-xr-xindra/newview/llmaniprotate.cpp18
-rwxr-xr-xindra/newview/llmanipscale.cpp16
-rwxr-xr-xindra/newview/llmaniptranslate.cpp9
-rwxr-xr-xindra/newview/llmediactrl.cpp18
-rwxr-xr-xindra/newview/llmediadataclient.cpp22
-rwxr-xr-xindra/newview/llmediadataclient.h7
-rwxr-xr-xindra/newview/llmorphview.cpp9
-rwxr-xr-xindra/newview/llnetmap.cpp29
-rwxr-xr-xindra/newview/llpanelclassified.cpp6
-rwxr-xr-xindra/newview/llpanelface.cpp4
-rw-r--r--indra/newview/llpanelgroupbulk.cpp2
-rwxr-xr-xindra/newview/llpanelgroupinvite.cpp2
-rwxr-xr-xindra/newview/llpanelgrouplandmoney.cpp4
-rwxr-xr-xindra/newview/llpanellandaudio.h1
-rwxr-xr-xindra/newview/llpanellandmarkinfo.cpp6
-rwxr-xr-xindra/newview/llpanellandmedia.h2
-rwxr-xr-xindra/newview/llpanellogin.cpp3
-rwxr-xr-xindra/newview/llpanelmaininventory.cpp10
-rwxr-xr-xindra/newview/llpanelobject.cpp12
-rwxr-xr-xindra/newview/llpanelobjectinventory.cpp4
-rwxr-xr-xindra/newview/llpanelpeople.h1
-rwxr-xr-xindra/newview/llpanelpick.cpp6
-rwxr-xr-xindra/newview/llpanelplaceinfo.cpp12
-rwxr-xr-xindra/newview/llpanelplaceprofile.cpp2
-rwxr-xr-xindra/newview/llpanelplaces.cpp1
-rwxr-xr-xindra/newview/llpanelprimmediacontrols.cpp8
-rwxr-xr-xindra/newview/llplacesinventorybridge.h2
-rwxr-xr-xindra/newview/llpreviewscript.cpp29
-rwxr-xr-xindra/newview/llpreviewscript.h1
-rw-r--r--indra/newview/llscripteditor.cpp1
-rwxr-xr-xindra/newview/llselectmgr.cpp5
-rwxr-xr-xindra/newview/llsidepanelappearance.h3
-rwxr-xr-xindra/newview/llsidepanelinventory.cpp3
-rwxr-xr-xindra/newview/llslurl.cpp24
-rw-r--r--indra/newview/llsnapshotlivepreview.cpp16
-rwxr-xr-xindra/newview/llspatialpartition.cpp2
-rwxr-xr-xindra/newview/llspeakers.cpp10
-rwxr-xr-xindra/newview/llstatusbar.cpp5
-rwxr-xr-xindra/newview/llsurface.cpp12
-rwxr-xr-xindra/newview/lltexturectrl.cpp21
-rwxr-xr-xindra/newview/lltexturefetch.cpp3
-rwxr-xr-xindra/newview/lltoastalertpanel.cpp1
-rwxr-xr-xindra/newview/lltoastgroupnotifypanel.h2
-rwxr-xr-xindra/newview/lltoolbrush.cpp3
-rwxr-xr-xindra/newview/lltoolcomp.cpp6
-rwxr-xr-xindra/newview/lltooldraganddrop.cpp34
-rwxr-xr-xindra/newview/lltoolfocus.cpp1
-rwxr-xr-xindra/newview/lltoolselectland.cpp4
-rw-r--r--indra/newview/lltwitterconnect.cpp2
-rwxr-xr-xindra/newview/llversioninfo.cpp2
-rwxr-xr-xindra/newview/llviewercontrol.cpp6
-rwxr-xr-xindra/newview/llviewerdisplay.cpp8
-rwxr-xr-xindra/newview/llviewerinventory.cpp16
-rwxr-xr-xindra/newview/llviewerinventory.h6
-rwxr-xr-xindra/newview/llviewerkeyboard.cpp44
-rwxr-xr-xindra/newview/llviewermedia.cpp6
-rwxr-xr-xindra/newview/llviewermessage.cpp9
-rwxr-xr-xindra/newview/llviewerobject.cpp36
-rwxr-xr-xindra/newview/llviewerobject.h4
-rwxr-xr-xindra/newview/llviewerparcelmgr.cpp18
-rwxr-xr-xindra/newview/llviewerpartsim.cpp5
-rwxr-xr-xindra/newview/llviewerpartsource.cpp2
-rwxr-xr-xindra/newview/llviewerregion.cpp3
-rwxr-xr-xindra/newview/llviewertexlayer.cpp3
-rwxr-xr-xindra/newview/llviewertexteditor.cpp5
-rwxr-xr-xindra/newview/llviewertexture.cpp1
-rwxr-xr-xindra/newview/llviewertextureanim.cpp2
-rwxr-xr-xindra/newview/llviewertexturelist.cpp3
-rwxr-xr-xindra/newview/llviewerwindow.cpp94
-rwxr-xr-xindra/newview/llvlcomposition.cpp12
-rwxr-xr-xindra/newview/llvoavatar.cpp577
-rwxr-xr-xindra/newview/llvoavatar.h14
-rwxr-xr-xindra/newview/llvoavatarself.cpp43
-rwxr-xr-xindra/newview/llvoavatarself.h6
-rwxr-xr-xindra/newview/llvograss.cpp1
-rwxr-xr-xindra/newview/llvoicechannel.cpp2
-rwxr-xr-xindra/newview/llvoiceclient.cpp7
-rwxr-xr-xindra/newview/llvoiceclient.h3
-rwxr-xr-xindra/newview/llvoicevisualizer.cpp1
-rwxr-xr-xindra/newview/llvoicevivox.cpp97
-rwxr-xr-xindra/newview/llvoicevivox.h3
-rwxr-xr-xindra/newview/llvopartgroup.cpp4
-rwxr-xr-xindra/newview/llvosky.cpp17
-rwxr-xr-xindra/newview/llvotree.cpp3
-rwxr-xr-xindra/newview/llvovolume.cpp84
-rwxr-xr-xindra/newview/llvowater.cpp9
-rwxr-xr-xindra/newview/llwearableitemslist.cpp10
-rwxr-xr-xindra/newview/llwearableitemslist.h4
-rwxr-xr-xindra/newview/llwindowlistener.cpp49
-rwxr-xr-xindra/newview/llwlanimator.cpp2
-rwxr-xr-xindra/newview/llworld.cpp5
-rwxr-xr-xindra/newview/llworldmapview.cpp45
-rwxr-xr-xindra/newview/pipeline.cpp16
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_about.xml57
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_joystick.xml2
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_openobject.xml71
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_pay.xml187
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_pay_object.xml194
-rwxr-xr-xindra/newview/skins/default/xui/en/menu_inventory.xml2
-rwxr-xr-xindra/newview/skins/default/xui/en/menu_viewer.xml12
-rwxr-xr-xindra/newview/skins/default/xui/en/notifications.xml13
-rwxr-xr-xindra/newview/skins/default/xui/en/strings.xml8
-rwxr-xr-xindra/newview/tests/lllogininstance_test.cpp12
-rwxr-xr-xindra/newview/viewer_manifest.py316
-rwxr-xr-xindra/test/CMakeLists.txt12
-rwxr-xr-xindra/test/llbuffer_tut.cpp1
-rwxr-xr-xindra/test/llevents_tut.cpp2
-rwxr-xr-xindra/test/llpermissions_tut.cpp2
-rwxr-xr-xindra/test/llsd_new_tut.cpp43
-rwxr-xr-xindra/test/lltranscode_tut.cpp3
-rwxr-xr-xindra/test/lltut.cpp43
-rwxr-xr-xindra/test/lltut.h85
-rwxr-xr-xindra/test/namedtempfile.h10
-rw-r--r--indra/test_apps/llfbconnecttest/CMakeLists.txt8
-rw-r--r--indra/test_apps/llfbconnecttest/llfbconnecttest.h36
-rwxr-xr-xindra/test_apps/llplugintest/CMakeLists.txt12
-rwxr-xr-xindra/tools/vstool/VSTool.exebin24576 -> 24576 bytes
-rwxr-xr-xindra/tools/vstool/main.cs8
-rwxr-xr-xindra/viewer_components/login/CMakeLists.txt3
383 files changed, 4488 insertions, 4166 deletions
diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt
index 24ea59ca49..10692402a5 100755
--- a/indra/CMakeLists.txt
+++ b/indra/CMakeLists.txt
@@ -20,12 +20,6 @@ if (NOT CMAKE_BUILD_TYPE)
"Build type. One of: Debug Release RelWithDebInfo" FORCE)
endif (NOT CMAKE_BUILD_TYPE)
-# For the library installation process;
-# see cmake/Prebuild.cmake for the counterpart code.
-if ("${CMAKE_SOURCE_DIR}/../autobuild.xml" IS_NEWER_THAN "${CMAKE_BINARY_DIR}/temp/sentinel_installed")
- file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/temp)
- file(WRITE ${CMAKE_BINARY_DIR}/temp/sentinel_installed "0")
-endif ("${CMAKE_SOURCE_DIR}/../autobuild.xml" IS_NEWER_THAN "${CMAKE_BINARY_DIR}/temp/sentinel_installed")
add_subdirectory(cmake)
add_subdirectory(${LIBS_OPEN_PREFIX}llaudio)
@@ -60,6 +54,7 @@ add_subdirectory(${LIBS_OPEN_PREFIX}viewer_components)
# Legacy C++ tests. Build always, run if LL_TESTS is true.
add_subdirectory(${VIEWER_PREFIX}test)
+if (ENABLE_MEDIA_PLUGINS)
# viewer media plugins
add_subdirectory(${LIBS_OPEN_PREFIX}media_plugins)
@@ -68,6 +63,7 @@ add_subdirectory(${LIBS_OPEN_PREFIX}media_plugins)
add_subdirectory(${VIEWER_PREFIX}test_apps/llplugintest)
add_subdirectory(${VIEWER_PREFIX}test_apps/llfbconnecttest)
endif (LL_TESTS AND NOT LINUX)
+endif (ENABLE_MEDIA_PLUGINS)
if (LINUX)
add_subdirectory(${VIEWER_PREFIX}linux_crash_logger)
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index 52b0f4e8b4..7a320ffc59 100755
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -49,12 +49,13 @@ if (WINDOWS)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MDd /MP -D_SCL_SECURE_NO_WARNINGS=1"
CACHE STRING "C++ compiler debug options" FORCE)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
- "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /MP /Ob0 -D_SECURE_STL=0"
+ "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /Zo /MD /MP /Ob0 -D_SECURE_STL=0"
CACHE STRING "C++ compiler release-with-debug options" FORCE)
set(CMAKE_CXX_FLAGS_RELEASE
- "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /MD /MP /Ob2 -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0"
+ "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /Zo /MD /MP /Ob2 -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0"
CACHE STRING "C++ compiler release options" FORCE)
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
+ # zlib has assembly-language object files incompatible with SAFESEH
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE /SAFESEH:NO /NODEFAULTLIB:LIBCMT")
set(CMAKE_CXX_STANDARD_LIBRARIES "")
set(CMAKE_C_STANDARD_LIBRARIES "")
@@ -190,22 +191,28 @@ if (DARWIN)
add_definitions(-DLL_DARWIN=1)
set(CMAKE_CXX_LINK_FLAGS "-Wl,-no_compact_unwind -Wl,-headerpad_max_install_names,-search_paths_first")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}")
- set(DARWIN_extra_cstar_flags "-mlong-branch -g")
+ set(DARWIN_extra_cstar_flags "-g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DARWIN_extra_cstar_flags}")
# NOTE: it's critical that the optimization flag is put in front.
# NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered.
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_C_FLAGS_RELWITHDEBINFO}")
- if (XCODE_VERSION GREATER 4.2)
- set(ENABLE_SIGNING TRUE)
- set(SIGNING_IDENTITY "Developer ID Application: Linden Research, Inc.")
- endif (XCODE_VERSION GREATER 4.2)
+ set(ENABLE_SIGNING TRUE)
+ set(SIGNING_IDENTITY "Developer ID Application: Linden Research, Inc.")
endif (DARWIN)
if (LINUX OR DARWIN)
- set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs")
+ if (CMAKE_CXX_COMPILER MATCHES ".*clang")
+ set(CMAKE_COMPILER_IS_CLANGXX 1)
+ endif (CMAKE_CXX_COMPILER MATCHES ".*clang")
+
+ if (CMAKE_COMPILER_IS_GNUCXX)
+ set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs")
+ elseif (CMAKE_COMPILER_IS_CLANGXX)
+ set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs")
+ endif()
if (NOT GCC_DISABLE_FATAL_WARNINGS)
set(GCC_WARNINGS "${GCC_WARNINGS} -Werror")
diff --git a/indra/cmake/Audio.cmake b/indra/cmake/Audio.cmake
index 876b7f82a8..f95439245a 100755
--- a/indra/cmake/Audio.cmake
+++ b/indra/cmake/Audio.cmake
@@ -8,7 +8,7 @@ if (USESYSTEMLIBS)
pkg_check_modules(VORBISENC REQUIRED vorbisenc)
pkg_check_modules(VORBISFILE REQUIRED vorbisfile)
else (USESYSTEMLIBS)
- use_prebuilt_binary(ogg-vorbis)
+ use_prebuilt_binary(ogg_vorbis)
set(VORBIS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
set(VORBISENC_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})
set(VORBISFILE_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})
diff --git a/indra/cmake/BerkeleyDB.cmake b/indra/cmake/BerkeleyDB.cmake
index 5f6b644a15..ee670ac650 100755
--- a/indra/cmake/BerkeleyDB.cmake
+++ b/indra/cmake/BerkeleyDB.cmake
@@ -1,5 +1,5 @@
# -*- cmake -*-
-
+include(Prebuilt)
set(DB_FIND_QUIETLY ON)
set(DB_FIND_REQUIRED ON)
diff --git a/indra/cmake/BuildPackagesInfo.cmake b/indra/cmake/BuildPackagesInfo.cmake
new file mode 100644
index 0000000000..0f574ee39a
--- /dev/null
+++ b/indra/cmake/BuildPackagesInfo.cmake
@@ -0,0 +1,10 @@
+# -*- cmake -*-
+# Construct the version and copyright information based on package data.
+include(Python)
+
+add_custom_command(OUTPUT packages-info.txt
+ COMMENT Generating packages-info.txt for the about box
+ MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/../autobuild.xml
+ DEPENDS ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py > packages-info.txt
+ )
diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt
index 10a23ea068..4d98e73092 100755
--- a/indra/cmake/CMakeLists.txt
+++ b/indra/cmake/CMakeLists.txt
@@ -23,7 +23,7 @@ set(cmake_SOURCE_FILES
DirectX.cmake
DragDrop.cmake
EXPAT.cmake
- ExamplePlugin.cmake
+## ExamplePlugin.cmake
FindAPR.cmake
FindAutobuild.cmake
FindBerkeleyDB.cmake
@@ -44,9 +44,9 @@ set(cmake_SOURCE_FILES
GLEXT.cmake
GLH.cmake
GLOD.cmake
- GStreamer010Plugin.cmake
+## GStreamer010Plugin.cmake
GetPrerequisites_2_8.cmake
- Glui.cmake
+## Glui.cmake
Glut.cmake
GoogleBreakpad.cmake
GoogleMock.cmake
@@ -81,18 +81,18 @@ set(cmake_SOURCE_FILES
LLXML.cmake
LScript.cmake
Linking.cmake
- MediaPluginBase.cmake
+## MediaPluginBase.cmake
NDOF.cmake
OPENAL.cmake
OpenGL.cmake
OpenJPEG.cmake
OpenSSL.cmake
PNG.cmake
- PluginAPI.cmake
+## PluginAPI.cmake
Prebuilt.cmake
PulseAudio.cmake
Python.cmake
- QuickTimePlugin.cmake
+## QuickTimePlugin.cmake
TemplateCheck.cmake
Tut.cmake
UI.cmake
@@ -100,7 +100,7 @@ set(cmake_SOURCE_FILES
Variables.cmake
ViewerMiscLibs.cmake
VisualLeakDetector.cmake
- WebKitLibPlugin.cmake
+## WebKitLibPlugin.cmake
XmlRpcEpi.cmake
ZLIB.cmake
)
diff --git a/indra/cmake/DBusGlib.cmake b/indra/cmake/DBusGlib.cmake
index d148a35a5b..5e46b6711a 100755
--- a/indra/cmake/DBusGlib.cmake
+++ b/indra/cmake/DBusGlib.cmake
@@ -7,7 +7,7 @@ if (USESYSTEMLIBS)
pkg_check_modules(DBUSGLIB REQUIRED dbus-glib-1)
elseif (LINUX)
- use_prebuilt_binary(dbusglib)
+ use_prebuilt_binary(dbus_glib)
set(DBUSGLIB_FOUND ON FORCE BOOL)
set(DBUSGLIB_INCLUDE_DIRS
${LIBS_PREBUILT_DIR}/include/dbus
diff --git a/indra/cmake/FindAutobuild.cmake b/indra/cmake/FindAutobuild.cmake
index 4b5fd484ae..ea5ad6d108 100755
--- a/indra/cmake/FindAutobuild.cmake
+++ b/indra/cmake/FindAutobuild.cmake
@@ -4,14 +4,18 @@
#
# Output variables:
#
-# AUTOBUILD_EXECUTABLE - path to autobuild or pautobuild executable
+# AUTOBUILD_EXECUTABLE - path to autobuild executable
+
-# *TODO - if cmake was executed by autobuild, autobuild will have set the AUTOBUILD env var
-# update this to check for that case
IF (NOT AUTOBUILD_EXECUTABLE)
+
+ # If cmake was executed by autobuild, autobuild will have set the AUTOBUILD env var
+ IF (DEFINED ENV{AUTOBUILD})
+ SET(AUTOBUILD_EXECUTABLE $ENV{AUTOBUILD})
+ ELSE (DEFINED ENV{AUTOBUILD})
IF(WIN32)
- SET(AUTOBUILD_EXE_NAMES autobuild.cmd autobuild.exe)
+ SET(AUTOBUILD_EXE_NAMES autobuild.exe autobuild.cmd)
ELSE(WIN32)
SET(AUTOBUILD_EXE_NAMES autobuild)
ENDIF(WIN32)
@@ -21,21 +25,19 @@ IF (NOT AUTOBUILD_EXECUTABLE)
AUTOBUILD_EXECUTABLE
NAMES ${AUTOBUILD_EXE_NAMES}
PATHS
- ENV PATH
- ${CMAKE_SOURCE_DIR}/..
- ${CMAKE_SOURCE_DIR}/../..
- ${CMAKE_SOURCE_DIR}/../../..
+ ENV PATH
+ ${CMAKE_SOURCE_DIR}/..
+ ${CMAKE_SOURCE_DIR}/../..
+ ${CMAKE_SOURCE_DIR}/../../..
PATH_SUFFIXES "/autobuild/bin/"
)
+ ENDIF (DEFINED ENV{AUTOBUILD})
- IF (AUTOBUILD_EXECUTABLE)
- GET_FILENAME_COMPONENT(_autobuild_name ${AUTOBUILD_EXECUTABLE} NAME_WE)
- MESSAGE(STATUS "Using autobuild at: ${AUTOBUILD_EXECUTABLE}")
- ELSE (AUTOBUILD_EXECUTABLE)
- IF (AUTOBUILD_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "Could not find autobuild executable")
- ENDIF (AUTOBUILD_FIND_REQUIRED)
- ENDIF (AUTOBUILD_EXECUTABLE)
+ IF (NOT AUTOBUILD_EXECUTABLE)
+ IF (AUTOBUILD_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find autobuild executable")
+ ENDIF (AUTOBUILD_FIND_REQUIRED)
+ ENDIF (NOT AUTOBUILD_EXECUTABLE)
- MARK_AS_ADVANCED(AUTOBUILD_EXECUTABLE)
+ MARK_AS_ADVANCED(AUTOBUILD_EXECUTABLE)
ENDIF (NOT AUTOBUILD_EXECUTABLE)
diff --git a/indra/cmake/GLEXT.cmake b/indra/cmake/GLEXT.cmake
index a749644202..2a08c8fbae 100644
--- a/indra/cmake/GLEXT.cmake
+++ b/indra/cmake/GLEXT.cmake
@@ -2,7 +2,9 @@
include(Prebuilt)
if (NOT USESYSTEMLIBS)
- use_prebuilt_binary(glext)
- use_prebuilt_binary(glh_linear)
+ if (WINDOWS OR LINUX)
+ use_prebuilt_binary(glext)
+ endif (WINDOWS OR LINUX)
+ use_prebuilt_binary(glh-linear)
set(GLEXT_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
endif (NOT USESYSTEMLIBS)
diff --git a/indra/cmake/GLH.cmake b/indra/cmake/GLH.cmake
index d5262f2efa..d0992f57b8 100755
--- a/indra/cmake/GLH.cmake
+++ b/indra/cmake/GLH.cmake
@@ -7,5 +7,5 @@ set(GLH_FIND_QUIETLY TRUE)
if (USESYSTEMLIBS)
include(FindGLH)
else (USESYSTEMLIBS)
- use_prebuilt_binary(glh_linear)
+ use_prebuilt_binary(glh-linear)
endif (USESYSTEMLIBS)
diff --git a/indra/cmake/GLOD.cmake b/indra/cmake/GLOD.cmake
index 3683768af9..a347eb6fee 100755
--- a/indra/cmake/GLOD.cmake
+++ b/indra/cmake/GLOD.cmake
@@ -2,7 +2,7 @@
include(Prebuilt)
if (NOT USESYSTEMLIBS)
- use_prebuilt_binary(GLOD)
+ use_prebuilt_binary(glod)
endif (NOT USESYSTEMLIBS)
set(GLOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
diff --git a/indra/cmake/GoogleMock.cmake b/indra/cmake/GoogleMock.cmake
index cac072988e..5a00546927 100755
--- a/indra/cmake/GoogleMock.cmake
+++ b/indra/cmake/GoogleMock.cmake
@@ -2,20 +2,20 @@
include(Prebuilt)
include(Linking)
-use_prebuilt_binary(gmock)
+use_prebuilt_binary(googlemock)
-set(GOOGLEMOCK_INCLUDE_DIRS
+set(GOOGLEMOCK_INCLUDE_DIRS
${LIBS_PREBUILT_DIR}/include)
if (LINUX)
# VWR-24366: gmock is underlinked, it needs gtest.
- set(GOOGLEMOCK_LIBRARIES
+ set(GOOGLEMOCK_LIBRARIES
gmock -Wl,--no-as-needed
gtest -Wl,--as-needed)
elseif(WINDOWS)
- set(GOOGLEMOCK_LIBRARIES
+ set(GOOGLEMOCK_LIBRARIES
gmock)
- set(GOOGLEMOCK_INCLUDE_DIRS
+ set(GOOGLEMOCK_INCLUDE_DIRS
${LIBS_PREBUILT_DIR}/include
${LIBS_PREBUILT_DIR}/include/gmock
${LIBS_PREBUILT_DIR}/include/gmock/boost/tr1/tr1)
diff --git a/indra/cmake/Havok.cmake b/indra/cmake/Havok.cmake
index 8b7f01d20b..99e7334118 100755
--- a/indra/cmake/Havok.cmake
+++ b/indra/cmake/Havok.cmake
@@ -1,5 +1,5 @@
# -*- cmake -*-
-
+include(Prebuilt)
if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
@@ -61,14 +61,14 @@ foreach(HAVOK_LIB ${HAVOK_LIBS})
set(relwithdebinfo_dir "${HAVOK_RELWITHDEBINFO_LIBRARY_PATH}/${HAVOK_LIB}")
# Try to avoid extracting havok library each time we run cmake.
- if("${havok_${HAVOK_LIB}_extracted}" STREQUAL "" AND EXISTS "${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted")
- file(READ ${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted "havok_${HAVOK_LIB}_extracted")
+ if("${havok_${HAVOK_LIB}_extracted}" STREQUAL "" AND EXISTS "${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted")
+ file(READ ${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted "havok_${HAVOK_LIB}_extracted")
if(DEBUG_PREBUILT)
message(STATUS "havok_${HAVOK_LIB}_extracted: \"${havok_${HAVOK_LIB}_extracted}\"")
endif(DEBUG_PREBUILT)
- endif("${havok_${HAVOK_LIB}_extracted}" STREQUAL "" AND EXISTS "${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted")
+ endif("${havok_${HAVOK_LIB}_extracted}" STREQUAL "" AND EXISTS "${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted")
- if(${CMAKE_BINARY_DIR}/temp/havok-source_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted OR NOT ${havok_${HAVOK_LIB}_extracted} EQUAL 0)
+ if(${PREBUILD_TRACKING_DIR}/havok_source_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted OR NOT ${havok_${HAVOK_LIB}_extracted} EQUAL 0)
if(DEBUG_PREBUILT)
MESSAGE(STATUS "Extracting ${HAVOK_LIB}...")
endif(DEBUG_PREBUILT)
@@ -109,9 +109,9 @@ foreach(HAVOK_LIB ${HAVOK_LIBS})
# Just assume success for now.
set(havok_${HAVOK_LIB}_extracted 0)
- file(WRITE ${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted "${havok_${HAVOK_LIB}_extracted}")
+ file(WRITE ${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted "${havok_${HAVOK_LIB}_extracted}")
- endif(${CMAKE_BINARY_DIR}/temp/havok-source_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/havok_${HAVOK_LIB}_extracted OR NOT ${havok_${HAVOK_LIB}_extracted} EQUAL 0)
+ endif(${PREBUILD_TRACKING_DIR}/havok_source_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/havok_${HAVOK_LIB}_extracted OR NOT ${havok_${HAVOK_LIB}_extracted} EQUAL 0)
file(GLOB extracted_debug "${debug_dir}/*.o")
file(GLOB extracted_release "${release_dir}/*.o")
diff --git a/indra/cmake/JsonCpp.cmake b/indra/cmake/JsonCpp.cmake
index 0aab2d6634..079619adf8 100755
--- a/indra/cmake/JsonCpp.cmake
+++ b/indra/cmake/JsonCpp.cmake
@@ -11,10 +11,10 @@ else (USESYSTEMLIBS)
use_prebuilt_binary(jsoncpp)
if (WINDOWS)
set(JSONCPP_LIBRARIES
- debug json_vc100debug_libmt.lib
- optimized json_vc100_libmt)
+ debug json_libmdd.lib
+ optimized json_libmd.lib)
elseif (DARWIN)
- set(JSONCPP_LIBRARIES libjson_linux-gcc-4.0.1_libmt.a)
+ set(JSONCPP_LIBRARIES libjson_darwin_libmt.a)
elseif (LINUX)
set(JSONCPP_LIBRARIES libjson_linux-gcc-4.1.3_libmt.a)
endif (WINDOWS)
diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake
index 804624f5ec..ac5c5c6a2a 100644
--- a/indra/cmake/LLAddBuildTest.cmake
+++ b/indra/cmake/LLAddBuildTest.cmake
@@ -137,7 +137,7 @@ INCLUDE(GoogleMock)
#
# Setup test targets
#
- GET_TARGET_PROPERTY(TEST_EXE PROJECT_${project}_TEST_${name} LOCATION)
+ SET(TEST_EXE $<TARGET_FILE:PROJECT_${project}_TEST_${name}>)
SET(TEST_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/PROJECT_${project}_TEST_${name}_ok.txt)
SET(TEST_CMD ${TEST_EXE} --touch=${TEST_OUTPUT} --sourcedir=${CMAKE_CURRENT_SOURCE_DIR})
@@ -225,7 +225,7 @@ FUNCTION(LL_ADD_INTEGRATION_TEST
# Create the test running command
SET(test_command ${ARGN})
- GET_TARGET_PROPERTY(TEST_EXE INTEGRATION_TEST_${testname} LOCATION)
+ SET(TEST_EXE $<TARGET_FILE:INTEGRATION_TEST_${testname}>)
LIST(FIND test_command "{}" test_exe_pos)
IF(test_exe_pos LESS 0)
# The {} marker means "the full pathname of the test executable."
diff --git a/indra/cmake/LLAppearanceUtility.cmake b/indra/cmake/LLAppearanceUtility.cmake
index bea45543de..709b91c134 100644
--- a/indra/cmake/LLAppearanceUtility.cmake
+++ b/indra/cmake/LLAppearanceUtility.cmake
@@ -4,7 +4,7 @@ include(Prebuilt)
# Linux proprietary build only
if (INSTALL_PROPRIETARY)
if(LINUX)
- use_prebuilt_binary(llappearanceutility-source)
+ use_prebuilt_binary(llappearance_utility)
set(LLAPPEARANCEUTILITY_SRC_DIR ${LIBS_PREBUILT_DIR}/llappearanceutility/src)
set(LLAPPEARANCEUTILITY_BIN_DIR ${CMAKE_BINARY_DIR}/llappearanceutility)
endif (LINUX)
diff --git a/indra/cmake/LLSharedLibs.cmake b/indra/cmake/LLSharedLibs.cmake
index 14dd67f32f..a3c1c871aa 100755
--- a/indra/cmake/LLSharedLibs.cmake
+++ b/indra/cmake/LLSharedLibs.cmake
@@ -1,7 +1,7 @@
# ll_deploy_sharedlibs_command
# target_exe: the cmake target of the executable for which the shared libs will be deployed.
macro(ll_deploy_sharedlibs_command target_exe)
- get_target_property(TARGET_LOCATION ${target_exe} LOCATION)
+ set(TARGET_LOCATION $<TARGET_FILE:${target_exe}>)
get_filename_component(OUTPUT_PATH ${TARGET_LOCATION} PATH)
if(DARWIN)
diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake
index 74fe3f1137..c95f0c3702 100755
--- a/indra/cmake/Linking.cmake
+++ b/indra/cmake/Linking.cmake
@@ -6,7 +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_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 e72845db53..388df16a52 100755
--- a/indra/cmake/NDOF.cmake
+++ b/indra/cmake/NDOF.cmake
@@ -8,7 +8,11 @@ if (NDOF)
set(NDOF_FIND_REQUIRED ON)
include(FindNDOF)
else (USESYSTEMLIBS)
- use_prebuilt_binary(ndofdev)
+ if (WINDOWS OR DARWIN)
+ use_prebuilt_binary(libndofdev)
+ elseif (LINUX)
+ use_prebuilt_binary(open-libndofdev)
+ endif (WINDOWS OR DARWIN)
if (WINDOWS)
set(NDOF_LIBRARY libndofdev)
diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake
index c084d68de7..1bbfff6f98 100755
--- a/indra/cmake/OPENAL.cmake
+++ b/indra/cmake/OPENAL.cmake
@@ -16,7 +16,7 @@ if (OPENAL)
pkg_check_modules(OPENAL_LIB REQUIRED openal)
pkg_check_modules(FREEALUT_LIB REQUIRED freealut)
else (USESYSTEMLIBS)
- use_prebuilt_binary(openal_soft)
+ use_prebuilt_binary(openal)
endif (USESYSTEMLIBS)
if(WINDOWS)
set(OPENAL_LIBRARIES
@@ -30,7 +30,3 @@ if (OPENAL)
)
endif()
endif (OPENAL)
-
-if (OPENAL)
- message(STATUS "Building with OpenAL audio support")
-endif (OPENAL)
diff --git a/indra/cmake/Prebuilt.cmake b/indra/cmake/Prebuilt.cmake
index e548805148..98013da2f2 100755
--- a/indra/cmake/Prebuilt.cmake
+++ b/indra/cmake/Prebuilt.cmake
@@ -8,44 +8,50 @@ if(INSTALL_PROPRIETARY)
include(FindSCP)
endif(INSTALL_PROPRIETARY)
+set(PREBUILD_TRACKING_DIR ${AUTOBUILD_INSTALL_DIR}/cmake_tracking)
+# For the library installation process;
+# see cmake/Prebuild.cmake for the counterpart code.
+if ("${CMAKE_SOURCE_DIR}/../autobuild.xml" IS_NEWER_THAN "${PREBUILD_TRACKING_DIR}/sentinel_installed")
+ file(MAKE_DIRECTORY ${PREBUILD_TRACKING_DIR})
+ file(WRITE ${PREBUILD_TRACKING_DIR}/sentinel_installed "0")
+endif ("${CMAKE_SOURCE_DIR}/../autobuild.xml" IS_NEWER_THAN "${PREBUILD_TRACKING_DIR}/sentinel_installed")
+
# The use_prebuilt_binary macro handles automated installation of package
# dependencies using autobuild. The goal is that 'autobuild install' should
# only be run when we know we need to install a new package. This should be
# the case in a clean checkout, or if autobuild.xml has been updated since the
-# last run (encapsulated by the file ${CMAKE_BINARY_DIR}/temp/sentinel_installed),
+# last run (encapsulated by the file ${PREBUILD_TRACKING_DIR}/sentinel_installed),
# or if a previous attempt to install the package has failed (the exit status
# of previous attempts is serialized in the file
-# ${CMAKE_BINARY_DIR}/temp/${_binary}_installed)
+# ${PREBUILD_TRACKING_DIR}/${_binary}_installed)
macro (use_prebuilt_binary _binary)
if (NOT DEFINED USESYSTEMLIBS_${_binary})
set(USESYSTEMLIBS_${_binary} ${USESYSTEMLIBS})
endif (NOT DEFINED USESYSTEMLIBS_${_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("${${_binary}_installed}" STREQUAL "" AND EXISTS "${PREBUILD_TRACKING_DIR}/${_binary}_installed")
+ file(READ ${PREBUILD_TRACKING_DIR}/${_binary}_installed "${_binary}_installed")
if(DEBUG_PREBUILT)
message(STATUS "${_binary}_installed: \"${${_binary}_installed}\"")
endif(DEBUG_PREBUILT)
- endif("${${_binary}_installed}" STREQUAL "" AND EXISTS "${CMAKE_BINARY_DIR}/temp/${_binary}_installed")
+ endif("${${_binary}_installed}" STREQUAL "" AND EXISTS "${PREBUILD_TRACKING_DIR}/${_binary}_installed")
- if(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0)
+ if(${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0)
if(DEBUG_PREBUILT)
message("cd ${CMAKE_SOURCE_DIR} && ${AUTOBUILD_EXECUTABLE} install
--install-dir=${AUTOBUILD_INSTALL_DIR}
- --skip-license-check
${_binary} ")
endif(DEBUG_PREBUILT)
execute_process(COMMAND "${AUTOBUILD_EXECUTABLE}"
install
--install-dir=${AUTOBUILD_INSTALL_DIR}
- --skip-license-check
${_binary}
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE ${_binary}_installed
)
- file(WRITE ${CMAKE_BINARY_DIR}/temp/${_binary}_installed "${${_binary}_installed}")
- endif(${CMAKE_BINARY_DIR}/temp/sentinel_installed IS_NEWER_THAN ${CMAKE_BINARY_DIR}/temp/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0)
+ file(WRITE ${PREBUILD_TRACKING_DIR}/${_binary}_installed "${${_binary}_installed}")
+ endif(${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0)
if(NOT ${_binary}_installed EQUAL 0)
message(FATAL_ERROR
diff --git a/indra/cmake/QuickTimePlugin.cmake b/indra/cmake/QuickTimePlugin.cmake
index 012f4e20d8..c08e153ee3 100755
--- a/indra/cmake/QuickTimePlugin.cmake
+++ b/indra/cmake/QuickTimePlugin.cmake
@@ -2,7 +2,9 @@
if(INSTALL_PROPRIETARY)
include(Prebuilt)
- use_prebuilt_binary(quicktime)
+ if (WINDOWS)
+ use_prebuilt_binary(quicktime)
+ endif (WINDOWS)
endif(INSTALL_PROPRIETARY)
if (DARWIN)
diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake
index 58acdc22bd..31174209a3 100755
--- a/indra/cmake/UI.cmake
+++ b/indra/cmake/UI.cmake
@@ -32,7 +32,10 @@ if (USESYSTEMLIBS)
add_definitions(${${pkg}_CFLAGS_OTHERS})
endforeach(pkg)
else (USESYSTEMLIBS)
- use_prebuilt_binary(gtk-atk-pango-glib)
+ if (LINUX OR WINDOWS)
+ use_prebuilt_binary(gtk-atk-pango-glib)
+ endif (LINUX OR WINDOWS)
+
if (LINUX)
set(UI_LIBRARIES
atk-1.0
diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake
index 963b1bd386..faca12c347 100755
--- a/indra/cmake/Variables.cmake
+++ b/indra/cmake/Variables.cmake
@@ -26,6 +26,7 @@ set(VIEWER_PREFIX)
set(INTEGRATION_TESTS_PREFIX)
set(LL_TESTS ON CACHE BOOL "Build and run unit and integration tests (disable for build timing runs to reduce variation")
set(INCREMENTAL_LINK OFF CACHE BOOL "Use incremental linking on win32 builds (enable for faster links on some machines)")
+set(ENABLE_MEDIA_PLUGINS OFF CACHE BOOL "Turn off building media plugins if they are imported by third-party library mechanism")
if(LIBS_CLOSED_DIR)
file(TO_CMAKE_PATH "${LIBS_CLOSED_DIR}" LIBS_CLOSED_DIR)
@@ -129,44 +130,25 @@ endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(DARWIN 1)
- execute_process(
- COMMAND sh -c "xcodebuild -version | grep Xcode | cut -d ' ' -f2 | cut -d'.' -f1-2"
- OUTPUT_VARIABLE XCODE_VERSION )
-
- # To support a different SDK update these Xcode settings:
- if (XCODE_VERSION GREATER 4.5)
- set(CMAKE_OSX_DEPLOYMENT_TARGET 10.8)
- set(CMAKE_OSX_SYSROOT macosx10.8)
- else (XCODE_VERSION GREATER 4.5)
- if (XCODE_VERSION GREATER 4.2)
- set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
- set(CMAKE_OSX_SYSROOT macosx10.7)
- else (XCODE_VERSION GREATER 4.2)
- set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
- set(CMAKE_OSX_SYSROOT macosx10.7)
- endif (XCODE_VERSION GREATER 4.2)
- endif (XCODE_VERSION GREATER 4.5)
-
- set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42")
+ # now we only support Xcode 6.0 using 10.9 (Mavericks), minimum OS 10.7 (Lion)
+ set(XCODE_VERSION 6.0)
+ set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7)
+ set(CMAKE_OSX_SYSROOT macosx10.9)
+
+ set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0")
+ set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL 3)
+ set(CMAKE_XCODE_ATTRIBUTE_GCC_STRICT_ALIASING NO)
+ set(CMAKE_XCODE_ATTRIBUTE_GCC_FAST_MATH YES)
+ set(CMAKE_XCODE_ATTRIBUTE_CLANG_X86_VECTOR_INSTRUCTIONS ssse3)
+ set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libstdc++")
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym)
- # NOTE: To attempt an i386/PPC Universal build, add this on the configure line:
- # -DCMAKE_OSX_ARCHITECTURES:STRING='i386;ppc'
- # Build only for i386 by default, system default on MacOSX 10.6 is x86_64
+ # Build only for i386 by default, system default on MacOSX 10.6+ is x86_64
if (NOT CMAKE_OSX_ARCHITECTURES)
- set(CMAKE_OSX_ARCHITECTURES i386)
+ set(CMAKE_OSX_ARCHITECTURES "i386")
endif (NOT CMAKE_OSX_ARCHITECTURES)
- if (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
- set(ARCH universal)
- else (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
- if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc")
- set(ARCH ppc)
- else (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc")
- set(ARCH i386)
- endif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc")
- endif (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
-
+ set(ARCH ${CMAKE_OSX_ARCHITECTURES})
set(LL_ARCH ${ARCH}_darwin)
set(LL_ARCH_DIR universal-darwin)
set(WORD_SIZE 32)
@@ -177,10 +159,8 @@ set(GRID agni CACHE STRING "Target Grid")
set(VIEWER_CHANNEL "Second Life Test" CACHE STRING "Viewer Channel Name")
-if (XCODE_VERSION GREATER 4.2)
- set(ENABLE_SIGNING OFF CACHE BOOL "Enable signing the viewer")
- set(SIGNING_IDENTITY "" CACHE STRING "Specifies the signing identity to use, if necessary.")
-endif (XCODE_VERSION GREATER 4.2)
+set(ENABLE_SIGNING OFF CACHE BOOL "Enable signing the viewer")
+set(SIGNING_IDENTITY "" CACHE STRING "Specifies the signing identity to use, if necessary.")
set(VERSION_BUILD "0" CACHE STRING "Revision number passed in from the outside")
set(USESYSTEMLIBS OFF CACHE BOOL "Use libraries from your system rather than Linden-supplied prebuilt libraries.")
diff --git a/indra/cmake/ViewerMiscLibs.cmake b/indra/cmake/ViewerMiscLibs.cmake
index d4be24799f..fc5bdedb5a 100755
--- a/indra/cmake/ViewerMiscLibs.cmake
+++ b/indra/cmake/ViewerMiscLibs.cmake
@@ -2,9 +2,11 @@
include(Prebuilt)
if (NOT USESYSTEMLIBS)
+ if (LINUX)
+ use_prebuilt_binary(libuuid)
+ use_prebuilt_binary(fontconfig)
+ endif (LINUX)
use_prebuilt_binary(libhunspell)
- use_prebuilt_binary(libuuid)
use_prebuilt_binary(slvoice)
- use_prebuilt_binary(fontconfig)
endif(NOT USESYSTEMLIBS)
diff --git a/indra/cmake/XmlRpcEpi.cmake b/indra/cmake/XmlRpcEpi.cmake
index 3a0caa0a06..8c3790ea89 100755
--- a/indra/cmake/XmlRpcEpi.cmake
+++ b/indra/cmake/XmlRpcEpi.cmake
@@ -9,7 +9,7 @@ if (USESYSTEMLIBS)
else (USESYSTEMLIBS)
use_prebuilt_binary(xmlrpc-epi)
if (WINDOWS)
- set(XMLRPCEPI_LIBRARIES
+ set(XMLRPCEPI_LIBRARIES
debug xmlrpc-epid
optimized xmlrpc-epi
)
diff --git a/indra/cmake/run_build_test.py b/indra/cmake/run_build_test.py
index a2ef61c8fd..582185e5ab 100755
--- a/indra/cmake/run_build_test.py
+++ b/indra/cmake/run_build_test.py
@@ -46,6 +46,7 @@ $/LicenseInfo$
import os
import sys
+import errno
import signal
import subprocess
@@ -112,7 +113,23 @@ def main(command, libpath=[], vars={}):
print "Running: %s" % " ".join(command)
# Make sure we see all relevant output *before* child-process output.
sys.stdout.flush()
- return subprocess.call(command)
+ try:
+ return subprocess.call(command)
+ except OSError as err:
+ # If the caller is trying to execute a test program that doesn't
+ # exist, we want to produce a reasonable error message rather than a
+ # traceback. This happens when the build is halted by errors, but
+ # CMake tries to proceed with testing anyway <eyeroll/>. However, do
+ # NOT attempt to handle any error but "doesn't exist."
+ if err.errno != errno.ENOENT:
+ raise
+ # In practice, the pathnames into CMake's build tree are so long as to
+ # obscure the name of the test program. Just print its basename.
+ print "No such program %s; check for preceding build errors" % \
+ os.path.basename(command[0])
+ # What rc should we simulate for missing executable? Windows produces
+ # 9009.
+ return 9009
# swiped from vita, sigh, seems like a Bad Idea to introduce dependency
def translate_rc(rc):
diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp
index 6fdf9e2e07..d1eb389013 100755
--- a/indra/llappearance/llavatarappearance.cpp
+++ b/indra/llappearance/llavatarappearance.cpp
@@ -584,8 +584,6 @@ BOOL LLAvatarAppearance::setupBone(const LLAvatarBoneInfo* info, LLJoint* parent
info->mRot.mV[VZ], LLQuaternion::XYZ));
joint->setScale(info->mScale);
- joint->setDefaultFromCurrentXform();
-
if (info->mIsJoint)
{
joint->setSkinOffset( info->mPivot );
@@ -677,6 +675,42 @@ void LLAvatarAppearance::clearSkeleton()
mSkeleton.clear();
}
+//------------------------------------------------------------------------
+// addPelvisFixup
+//------------------------------------------------------------------------
+void LLAvatarAppearance::addPelvisFixup( F32 fixup, const LLUUID& mesh_id )
+{
+ LLVector3 pos(0.0,0.0,fixup);
+ mPelvisFixups.add(mesh_id,pos);
+}
+
+//------------------------------------------------------------------------
+// addPelvisFixup
+//------------------------------------------------------------------------
+void LLAvatarAppearance::removePelvisFixup( const LLUUID& mesh_id )
+{
+ mPelvisFixups.remove(mesh_id);
+}
+
+//------------------------------------------------------------------------
+// hasPelvisFixup
+//------------------------------------------------------------------------
+bool LLAvatarAppearance::hasPelvisFixup( F32& fixup, LLUUID& mesh_id ) const
+{
+ LLVector3 pos;
+ if (mPelvisFixups.findActiveOverride(mesh_id,pos))
+ {
+ fixup = pos[2];
+ return true;
+ }
+ return false;
+}
+
+bool LLAvatarAppearance::hasPelvisFixup( F32& fixup ) const
+{
+ LLUUID mesh_id;
+ return hasPelvisFixup( fixup, mesh_id );
+}
//-----------------------------------------------------------------------------
// LLAvatarAppearance::buildCharacter()
// Deferred initialization and rebuild of the avatar.
diff --git a/indra/llappearance/llavatarappearance.h b/indra/llappearance/llavatarappearance.h
index 1e898026c0..a0ef49b7cb 100755
--- a/indra/llappearance/llavatarappearance.h
+++ b/indra/llappearance/llavatarappearance.h
@@ -152,11 +152,17 @@ protected:
BOOL mIsBuilt; // state of deferred character building
typedef std::vector<LLAvatarJoint*> avatar_joint_list_t;
avatar_joint_list_t mSkeleton;
-
+ LLPosOverrideMap mPelvisFixups;
+
//--------------------------------------------------------------------
// Pelvis height adjustment members.
//--------------------------------------------------------------------
public:
+ void addPelvisFixup( F32 fixup, const LLUUID& mesh_id );
+ void removePelvisFixup( const LLUUID& mesh_id );
+ bool hasPelvisFixup( F32& fixup, LLUUID& mesh_id ) const;
+ bool hasPelvisFixup( F32& fixup ) const;
+
LLVector3 mBodySize;
LLVector3 mAvatarOffset;
protected:
diff --git a/indra/llappearance/llpolymorph.h b/indra/llappearance/llpolymorph.h
index 7e712f9e94..3c2c68079c 100644
--- a/indra/llappearance/llpolymorph.h
+++ b/indra/llappearance/llpolymorph.h
@@ -182,6 +182,16 @@ public:
void applyMask(U8 *maskData, S32 width, S32 height, S32 num_components, BOOL invert);
void addPendingMorphMask() { mNumMorphMasksPending++; }
+ void* operator new(size_t size)
+ {
+ return ll_aligned_malloc_16(size);
+ }
+
+ void operator delete(void* ptr)
+ {
+ ll_aligned_free_16(ptr);
+ }
+
protected:
LLPolyMorphTarget(const LLPolyMorphTarget& pOther);
diff --git a/indra/llappearance/llpolyskeletaldistortion.cpp b/indra/llappearance/llpolyskeletaldistortion.cpp
index ea29cbd451..fbc312c426 100644
--- a/indra/llappearance/llpolyskeletaldistortion.cpp
+++ b/indra/llappearance/llpolyskeletaldistortion.cpp
@@ -213,7 +213,7 @@ void LLPolySkeletalDistortion::apply( ESex avatar_sex )
LLVector3 scaleDelta = iter->second;
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 );
+ // needed? // joint->storeScaleForReset( newScale );
joint->setScale(newScale);
}
diff --git a/indra/llappearance/llpolyskeletaldistortion.h b/indra/llappearance/llpolyskeletaldistortion.h
index ea2adb8a87..ab1a132d19 100644
--- a/indra/llappearance/llpolyskeletaldistortion.h
+++ b/indra/llappearance/llpolyskeletaldistortion.h
@@ -73,6 +73,19 @@ public:
/*virtual*/ BOOL parseXml(LLXmlTreeNode* node);
+
+
+ void* operator new(size_t size)
+ {
+ return ll_aligned_malloc_16(size);
+ }
+
+ void operator delete(void* ptr)
+ {
+ ll_aligned_free_16(ptr);
+ }
+
+
protected:
typedef std::vector<LLPolySkeletalBoneInfo> bone_info_list_t;
bone_info_list_t mBoneInfoList;
diff --git a/indra/llappearance/lltexturemanagerbridge.h b/indra/llappearance/lltexturemanagerbridge.h
index 4b814b522d..101704b162 100644
--- a/indra/llappearance/lltexturemanagerbridge.h
+++ b/indra/llappearance/lltexturemanagerbridge.h
@@ -35,6 +35,8 @@
class LLTextureManagerBridge
{
public:
+ virtual ~LLTextureManagerBridge() {}
+
virtual LLPointer<LLGLTexture> getLocalTexture(BOOL usemipmaps = TRUE, BOOL generate_gl_tex = TRUE) = 0;
virtual LLPointer<LLGLTexture> getLocalTexture(const U32 width, const U32 height, const U8 components, BOOL usemipmaps, BOOL generate_gl_tex = TRUE) = 0;
virtual LLGLTexture* getFetchedTexture(const LLUUID &image_id) = 0;
diff --git a/indra/llappearance/llwearable.h b/indra/llappearance/llwearable.h
index 406fc7e883..630eb1e3a5 100755
--- a/indra/llappearance/llwearable.h
+++ b/indra/llappearance/llwearable.h
@@ -113,6 +113,9 @@ public:
// Update the baked texture hash.
virtual void addToBakedTextureHash(LLMD5& hash) const = 0;
+ typedef std::map<S32, LLVisualParam *> visual_param_index_map_t;
+ visual_param_index_map_t mVisualParamIndexMap;
+
protected:
typedef std::map<S32, LLLocalTextureObject*> te_map_t;
void syncImages(te_map_t &src, te_map_t &dst);
@@ -132,9 +135,6 @@ protected:
typedef std::map<S32, F32> param_map_t;
param_map_t mSavedVisualParamMap; // last saved version of visual params
- typedef std::map<S32, LLVisualParam *> visual_param_index_map_t;
- visual_param_index_map_t mVisualParamIndexMap;
-
te_map_t mTEMap; // maps TE to LocalTextureObject
te_map_t mSavedTEMap; // last saved version of TEMap
};
diff --git a/indra/llappearance/llwearabledata.cpp b/indra/llappearance/llwearabledata.cpp
index cf1ee435a8..5dfb201fc4 100755
--- a/indra/llappearance/llwearabledata.cpp
+++ b/indra/llappearance/llwearabledata.cpp
@@ -173,8 +173,9 @@ bool LLWearableData::swapWearables(const LLWearableType::EType type, U32 index_a
}
wearableentry_vec_t& wearable_vec = wearable_iter->second;
- if (0 > index_a || index_a >= wearable_vec.size()) return false;
- if (0 > index_b || index_b >= wearable_vec.size()) return false;
+ // removed 0 > index_a and index_b comparisions - can never be true
+ if (index_a >= wearable_vec.size()) return false;
+ if (index_b >= wearable_vec.size()) return false;
LLWearable* wearable = wearable_vec[index_a];
wearable_vec[index_a] = wearable_vec[index_b];
diff --git a/indra/llappearance/llwearabletype.h b/indra/llappearance/llwearabletype.h
index e51e6731d3..7c9594644d 100644
--- a/indra/llappearance/llwearabletype.h
+++ b/indra/llappearance/llwearabletype.h
@@ -35,6 +35,9 @@
class LLTranslationBridge
{
public:
+ // clang needs this to be happy
+ virtual ~LLTranslationBridge() {}
+
virtual std::string getString(const std::string &xml_desc) = 0;
};
diff --git a/indra/llaudio/CMakeLists.txt b/indra/llaudio/CMakeLists.txt
index 1b2bdb9888..e943dd5d5c 100755
--- a/indra/llaudio/CMakeLists.txt
+++ b/indra/llaudio/CMakeLists.txt
@@ -3,7 +3,6 @@
project(llaudio)
include(00-Common)
-include(Audio)
include(LLAudio)
include(FMODEX)
include(OPENAL)
diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp
index 20a7afc748..77e57b14f5 100755
--- a/indra/llaudio/llaudiodecodemgr.cpp
+++ b/indra/llaudio/llaudiodecodemgr.cpp
@@ -247,8 +247,7 @@ BOOL LLVorbisDecodeState::initDecode()
LL_WARNS("AudioEngine") << "Illegal sample count: " << sample_count << LL_ENDL;
}
- if( size_guess > LLVORBIS_CLIP_REJECT_SIZE ||
- size_guess < 0)
+ if( size_guess > LLVORBIS_CLIP_REJECT_SIZE )
{
abort_decode = true;
LL_WARNS("AudioEngine") << "Illegal sample size: " << size_guess << LL_ENDL;
@@ -697,11 +696,3 @@ BOOL LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid)
LL_DEBUGS("AudioEngine") << "addDecodeRequest for " << uuid << " no file available" << LL_ENDL;
return FALSE;
}
-
-#if LL_DARWIN || LL_LINUX
-// HACK: to fool the compiler into not emitting unused warnings.
-namespace {
- const ov_callbacks callback_array[4] = {OV_CALLBACKS_DEFAULT, OV_CALLBACKS_NOCLOSE, OV_CALLBACKS_STREAMONLY,
- OV_CALLBACKS_STREAMONLY_NOCLOSE};
-}
-#endif
diff --git a/indra/llcharacter/lleditingmotion.cpp b/indra/llcharacter/lleditingmotion.cpp
index 36341065ae..f4a37a139a 100755
--- a/indra/llcharacter/lleditingmotion.cpp
+++ b/indra/llcharacter/lleditingmotion.cpp
@@ -39,8 +39,6 @@
//-----------------------------------------------------------------------------
const LLQuaternion EDIT_MOTION_WRIST_ROTATION(F_PI_BY_TWO * 0.7f, LLVector3(1.0f, 0.0f, 0.0f));
const F32 TARGET_LAG_HALF_LIFE = 0.1f; // half-life of IK targeting
-const F32 TORSO_LAG_HALF_LIFE = 0.2f;
-const F32 MAX_TIME_DELTA = 2.f; //max two seconds a frame for calculating interpolation
S32 LLEditingMotion::sHandPose = LLHandMotion::HAND_POSE_RELAXED_R;
S32 LLEditingMotion::sHandPosePriority = 3;
diff --git a/indra/llcharacter/llheadrotmotion.cpp b/indra/llcharacter/llheadrotmotion.cpp
index d045bca22e..812c4201af 100755
--- a/indra/llcharacter/llheadrotmotion.cpp
+++ b/indra/llcharacter/llheadrotmotion.cpp
@@ -43,11 +43,8 @@ const F32 TORSO_LAG = 0.35f; // torso rotation factor
const F32 NECK_LAG = 0.5f; // neck rotation factor
const F32 HEAD_LOOKAT_LAG_HALF_LIFE = 0.15f; // half-life of lookat targeting for head
const F32 TORSO_LOOKAT_LAG_HALF_LIFE = 0.27f; // half-life of lookat targeting for torso
-const F32 EYE_LOOKAT_LAG_HALF_LIFE = 0.06f; // half-life of lookat targeting for eye
const F32 HEAD_ROTATION_CONSTRAINT = F_PI_BY_TWO * 0.8f; // limit angle for head rotation
-
const F32 MIN_HEAD_LOOKAT_DISTANCE = 0.3f; // minimum distance from head before we turn to look at it
-const F32 MAX_TIME_DELTA = 2.f; //max two seconds a frame for calculating interpolation
const F32 EYE_JITTER_MIN_TIME = 0.3f; // min amount of time between eye "jitter" motions
const F32 EYE_JITTER_MAX_TIME = 2.5f; // max amount of time between eye "jitter" motions
const F32 EYE_JITTER_MAX_YAW = 0.08f; // max yaw of eye jitter motion
diff --git a/indra/llcharacter/lljoint.cpp b/indra/llcharacter/lljoint.cpp
index dbd6d48a95..6f22a7c6b7 100755
--- a/indra/llcharacter/lljoint.cpp
+++ b/indra/llcharacter/lljoint.cpp
@@ -36,6 +36,64 @@
S32 LLJoint::sNumUpdates = 0;
S32 LLJoint::sNumTouches = 0;
+template <class T>
+bool attachment_map_iter_compare_key(const T& a, const T& b)
+{
+ return a.first < b.first;
+}
+
+bool LLPosOverrideMap::findActiveOverride(LLUUID& mesh_id, LLVector3& pos) const
+{
+ pos = LLVector3(0,0,0);
+ mesh_id = LLUUID();
+ bool found = false;
+
+ map_type::const_iterator it = std::max_element(m_map.begin(),
+ m_map.end(),
+ attachment_map_iter_compare_key<map_type::value_type>);
+ if (it != m_map.end())
+ {
+ found = true;
+ pos = it->second;
+ mesh_id = it->first;
+ }
+ return found;
+}
+
+void LLPosOverrideMap::showJointPosOverrides( std::ostringstream& os ) const
+{
+ map_type::const_iterator max_it = std::max_element(m_map.begin(),
+ m_map.end(),
+ attachment_map_iter_compare_key<map_type::value_type>);
+ for (map_type::const_iterator it = m_map.begin();
+ it != m_map.end(); ++it)
+ {
+ const LLVector3& pos = it->second;
+ os << " " << "[" << it->first <<": " << pos << "]" << ((it==max_it) ? "*" : "");
+ }
+}
+
+U32 LLPosOverrideMap::count() const
+{
+ return m_map.size();
+}
+
+void LLPosOverrideMap::add(const LLUUID& mesh_id, const LLVector3& pos)
+{
+ m_map[mesh_id] = pos;
+}
+
+bool LLPosOverrideMap::remove(const LLUUID& mesh_id)
+{
+ U32 remove_count = m_map.erase(mesh_id);
+ return (remove_count > 0);
+}
+
+void LLPosOverrideMap::clear()
+{
+ m_map.clear();
+}
+
//-----------------------------------------------------------------------------
// LLJoint()
// Class Constructor
@@ -48,11 +106,8 @@ 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() :
@@ -233,52 +288,123 @@ const LLVector3& LLJoint::getPosition()
return mXform.getPosition();
}
+bool do_debug_joint(const std::string& name)
+{
+ return true;
+}
//--------------------------------------------------------------------
// setPosition()
//--------------------------------------------------------------------
void LLJoint::setPosition( const LLVector3& pos )
{
+ if (pos != getPosition())
+ {
+ if (do_debug_joint(getName()))
+ {
+ LL_DEBUGS("Avatar") << " joint " << getName() << " set pos " << pos << LL_ENDL;
+ }
+ }
mXform.setPosition(pos);
touch(MATRIX_DIRTY | POSITION_DIRTY);
}
+void showJointPosOverrides( const LLJoint& joint, const std::string& note, const std::string& av_info )
+{
+ std::ostringstream os;
+ os << joint.m_posBeforeOverrides;
+ joint.m_attachmentOverrides.showJointPosOverrides(os);
+ LL_DEBUGS("Avatar") << av_info << " joint " << joint.getName() << " " << note << " " << os.str() << LL_ENDL;
+}
//--------------------------------------------------------------------
-// setPosition()
+// addAttachmentPosOverride()
//--------------------------------------------------------------------
-void LLJoint::setDefaultFromCurrentXform( void )
-{
- mDefaultXform = mXform;
+void LLJoint::addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh_id, const std::string& av_info )
+{
+ if (mesh_id.isNull())
+ {
+ return;
+ }
+ if (!m_attachmentOverrides.count())
+ {
+ if (do_debug_joint(getName()))
+ {
+ LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " saving m_posBeforeOverrides " << getPosition() << LL_ENDL;
+ }
+ m_posBeforeOverrides = getPosition();
+ }
+ m_attachmentOverrides.add(mesh_id,pos);
+ if (do_debug_joint(getName()))
+ {
+ LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " addAttachmentPosOverride for mesh " << mesh_id << " pos " << pos << LL_ENDL;
+ }
+ updatePos(av_info);
}
//--------------------------------------------------------------------
-// storeCurrentXform()
+// removeAttachmentPosOverride()
//--------------------------------------------------------------------
-void LLJoint::storeCurrentXform( const LLVector3& pos )
-{
- mOldXform = mXform;
- mResetAfterRestoreOldXform = true;
- setPosition( pos );
- touch(ALL_DIRTY);
+void LLJoint::removeAttachmentPosOverride( const LLUUID& mesh_id, const std::string& av_info )
+{
+ if (mesh_id.isNull())
+ {
+ return;
+ }
+ if (m_attachmentOverrides.remove(mesh_id))
+ {
+ if (do_debug_joint(getName()))
+ {
+ LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName()
+ << " removeAttachmentPosOverride for " << mesh_id << LL_ENDL;
+ showJointPosOverrides(*this, "remove", av_info);
+ }
+ updatePos(av_info);
+ }
+
}
//--------------------------------------------------------------------
-// storeScaleForReset()
+ // hasAttachmentPosOverride()
+ //--------------------------------------------------------------------
+bool LLJoint::hasAttachmentPosOverride( LLVector3& pos, LLUUID& mesh_id ) const
+{
+ return m_attachmentOverrides.findActiveOverride(mesh_id,pos);
+}
+
+//--------------------------------------------------------------------
+// clearAttachmentPosOverrides()
//--------------------------------------------------------------------
-void LLJoint::storeScaleForReset( const LLVector3& scale )
+void LLJoint::clearAttachmentPosOverrides()
{
- mOldXform.setScale( scale );
+ if (m_attachmentOverrides.count())
+ {
+ m_attachmentOverrides.clear();
+ setPosition(m_posBeforeOverrides);
+ setId( LLUUID::null );
+ }
}
+
//--------------------------------------------------------------------
-// restoreOldXform()
+// updatePos()
//--------------------------------------------------------------------
-void LLJoint::restoreOldXform( void )
-{
- mXform = mDefaultXform;
- mResetAfterRestoreOldXform = false;
- mDirtyFlags = ALL_DIRTY;
+void LLJoint::updatePos(const std::string& av_info)
+{
+ LLVector3 pos, found_pos;
+ LLUUID mesh_id;
+ if (m_attachmentOverrides.findActiveOverride(mesh_id,found_pos))
+ {
+ LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " updatePos, winner of " << m_attachmentOverrides.count() << " is mesh " << mesh_id << " pos " << found_pos << LL_ENDL;
+ pos = found_pos;
+ }
+ else
+ {
+ LL_DEBUGS("Avatar") << "av " << av_info << " joint " << getName() << " updatePos, winner is posBeforeOverrides " << m_posBeforeOverrides << LL_ENDL;
+ pos = m_posBeforeOverrides;
+ }
+ setPosition(pos);
}
+
//--------------------------------------------------------------------
// getWorldPosition()
//--------------------------------------------------------------------
@@ -325,7 +451,7 @@ void LLJoint::setWorldPosition( const LLVector3& pos )
//--------------------------------------------------------------------
-// mXform.getRotation()
+// getRotation()
//--------------------------------------------------------------------
const LLQuaternion& LLJoint::getRotation()
{
@@ -432,7 +558,7 @@ const LLMatrix4 &LLJoint::getWorldMatrix()
//--------------------------------------------------------------------
void LLJoint::setWorldMatrix( const LLMatrix4& mat )
{
-LL_INFOS() << "WARNING: LLJoint::setWorldMatrix() not correctly implemented yet" << LL_ENDL;
+ LL_INFOS() << "WARNING: LLJoint::setWorldMatrix() not correctly implemented yet" << LL_ENDL;
// extract global translation
LLVector3 trans( mat.mMatrix[VW][VX],
mat.mMatrix[VW][VY],
@@ -548,20 +674,6 @@ void LLJoint::clampRotation(LLQuaternion old_rot, LLQuaternion new_rot)
break;
}
}
-
- // 2003.03.26 - This code was just using up cpu cycles. AB
-
-// LLVector3 old_axis = main_axis * old_rot;
-// LLVector3 new_axis = main_axis * new_rot;
-
-// for (S32 i = 0; i < mConstraintSilhouette.size() - 1; i++)
-// {
-// LLVector3 vert1 = mConstraintSilhouette[i];
-// LLVector3 vert2 = mConstraintSilhouette[i + 1];
-
- // figure out how to clamp rotation to line on 3-sphere
-
-// }
}
// End
diff --git a/indra/llcharacter/lljoint.h b/indra/llcharacter/lljoint.h
index b65d6979d4..2abe1d6db1 100755
--- a/indra/llcharacter/lljoint.h
+++ b/indra/llcharacter/lljoint.h
@@ -46,6 +46,21 @@ const U32 LL_FACE_JOINT_NUM = 30;
const S32 LL_CHARACTER_MAX_PRIORITY = 7;
const F32 LL_MAX_PELVIS_OFFSET = 5.f;
+class LLPosOverrideMap
+{
+public:
+ LLPosOverrideMap() {}
+ bool findActiveOverride(LLUUID& mesh_id, LLVector3& pos) const;
+ void showJointPosOverrides(std::ostringstream& os) const;
+ U32 count() const;
+ void add(const LLUUID& mesh_id, const LLVector3& pos);
+ bool remove(const LLUUID& mesh_id);
+ void clear();
+private:
+ typedef std::map<LLUUID,LLVector3> map_type;
+ map_type m_map;
+};
+
//-----------------------------------------------------------------------------
// class LLJoint
//-----------------------------------------------------------------------------
@@ -79,8 +94,6 @@ protected:
// explicit transformation members
LLXformMatrix mXform;
- LLXformMatrix mOldXform;
- LLXformMatrix mDefaultXform;
LLUUID mId;
@@ -88,8 +101,6 @@ public:
U32 mDirtyFlags;
BOOL mUpdateXform;
- BOOL mResetAfterRestoreOldXform;
-
// describes the skin binding pose
LLVector3 mSkinOffset;
@@ -103,6 +114,11 @@ public:
static S32 sNumTouches;
static S32 sNumUpdates;
+ LLPosOverrideMap m_attachmentOverrides;
+ LLVector3 m_posBeforeOverrides;
+
+ void updatePos(const std::string& av_info);
+
public:
LLJoint();
LLJoint(S32 joint_num);
@@ -160,7 +176,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 );
@@ -183,20 +199,16 @@ public:
virtual BOOL isAnimatable() const { return TRUE; }
S32 getJointNum() const { return mJointNum; }
-
- void restoreOldXform( void );
- void setDefaultFromCurrentXform( void );
- void storeCurrentXform( const LLVector3& pos );
+
+ void addAttachmentPosOverride( const LLVector3& pos, const LLUUID& mesh_id, const std::string& av_info );
+ void removeAttachmentPosOverride( const LLUUID& mesh_id, const std::string& av_info );
+ bool hasAttachmentPosOverride( LLVector3& pos, LLUUID& mesh_id ) const;
+ void clearAttachmentPosOverrides();
//Accessor for the joint id
LLUUID getId( void ) { return mId; }
//Setter for the joints id
void setId( const LLUUID& id ) { mId = id;}
-
- //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; }
- void setJointResetFlag( bool val ) { mResetAfterRestoreOldXform = val; }
-
};
#endif // LL_LLJOINT_H
diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp
index 22aa4f1d2f..cd201a65b4 100755
--- a/indra/llcharacter/llkeyframemotion.cpp
+++ b/indra/llcharacter/llkeyframemotion.cpp
@@ -902,7 +902,7 @@ void LLKeyframeMotion::deactivateConstraint(JointConstraint *constraintp)
constraintp->mSourceVolume->mUpdateXform = FALSE;
}
- if (!constraintp->mSharedData->mConstraintTargetType == CONSTRAINT_TARGET_TYPE_GROUND)
+ if (constraintp->mSharedData->mConstraintTargetType != CONSTRAINT_TARGET_TYPE_GROUND)
{
if (constraintp->mTargetVolume)
{
@@ -1048,7 +1048,7 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8
LLVector3 source_to_target = target_pos - keyframe_source_pos;
- S32 max_iteration_count = llround(clamp_rescale(
+ S32 max_iteration_count = ll_round(clamp_rescale(
mCharacter->getPixelArea(),
MAX_PIXEL_AREA_CONSTRAINTS,
MIN_PIXEL_AREA_CONSTRAINTS,
diff --git a/indra/llcharacter/llkeyframewalkmotion.cpp b/indra/llcharacter/llkeyframewalkmotion.cpp
index 7c1fcacf8a..f180702385 100755
--- a/indra/llcharacter/llkeyframewalkmotion.cpp
+++ b/indra/llcharacter/llkeyframewalkmotion.cpp
@@ -45,10 +45,7 @@ const F32 TIME_EPSILON = 0.001f; // minumum frame time
const F32 MAX_TIME_DELTA = 2.f; // max two seconds a frame for calculating interpolation
F32 SPEED_ADJUST_MAX_SEC = 2.f; // maximum adjustment to walk animation playback speed for a second
F32 ANIM_SPEED_MAX = 1.5f; // absolute upper limit on animation speed
-const F32 DRIFT_COMP_MAX_TOTAL = 0.1f; // maximum drift compensation overall, in any direction
-const F32 DRIFT_COMP_MAX_SPEED = 4.f; // speed at which drift compensation total maxes out
const F32 MAX_ROLL = 0.6f;
-const F32 PELVIS_COMPENSATION_WIEGHT = 0.7f; // proportion of foot drift that is compensated by moving the avatar directly
const F32 SPEED_ADJUST_TIME_CONSTANT = 0.1f; // time constant for speed adjustment interpolation
//-----------------------------------------------------------------------------
diff --git a/indra/llcharacter/lltargetingmotion.cpp b/indra/llcharacter/lltargetingmotion.cpp
index 007834b178..69681e4197 100755
--- a/indra/llcharacter/lltargetingmotion.cpp
+++ b/indra/llcharacter/lltargetingmotion.cpp
@@ -38,9 +38,6 @@
// Constants
//-----------------------------------------------------------------------------
const F32 TORSO_TARGET_HALF_LIFE = 0.25f;
-const F32 MAX_TIME_DELTA = 2.f; //max two seconds a frame for calculating interpolation
-const F32 TARGET_PLANE_THRESHOLD_DOT = 0.6f;
-const F32 TORSO_ROT_FRACTION = 0.5f;
//-----------------------------------------------------------------------------
// LLTargetingMotion()
diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt
index 763f5a3521..63d25225c9 100755
--- a/indra/llcommon/CMakeLists.txt
+++ b/indra/llcommon/CMakeLists.txt
@@ -301,7 +301,7 @@ if (LL_TESTS)
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};${BOOST_COROUTINE_LIBRARY};${BOOST_SYSTEM_LIBRARY}")
+ LL_ADD_INTEGRATION_TEST(lleventcoro "" "${test_libs};${BOOST_CONTEXT_LIBRARY};${BOOST_THREAD_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/llerror.cpp b/indra/llcommon/llerror.cpp
index 22cd861c72..8119b14887 100755
--- a/indra/llcommon/llerror.cpp
+++ b/indra/llcommon/llerror.cpp
@@ -126,7 +126,7 @@ namespace {
mFile.close();
}
- bool okay() { return mFile; }
+ bool okay() { return mFile.good(); }
virtual void recordMessage(LLError::ELevel level,
const std::string& message)
diff --git a/indra/llcommon/lleventcoro.h b/indra/llcommon/lleventcoro.h
index a42af63b65..abbeeaa373 100755
--- a/indra/llcommon/lleventcoro.h
+++ b/indra/llcommon/lleventcoro.h
@@ -67,7 +67,7 @@ public:
LLEventPumpOrPumpName() {}
operator LLEventPump& () const { return *mPump; }
LLEventPump& getPump() const { return *mPump; }
- operator bool() const { return mPump; }
+ operator bool() const { return bool(mPump); }
bool operator!() const { return ! mPump; }
private:
@@ -102,6 +102,9 @@ LLVoidListener<LISTENER> voidlistener(const LISTENER& listener)
namespace LLEventDetail
{
+ /// Implementation for listenerNameForCoro(), see below
+ LL_COMMON_API std::string listenerNameForCoroImpl(const void* self_id);
+
/**
* waitForEventOn() permits a coroutine to temporarily listen on an
* LLEventPump any number of times. We don't really want to have to ask
@@ -129,9 +132,6 @@ namespace LLEventDetail
return listenerNameForCoroImpl(self.get_id());
}
- /// Implementation for listenerNameForCoro()
- LL_COMMON_API std::string listenerNameForCoroImpl(const void* self_id);
-
/**
* Implement behavior described for postAndWait()'s @a replyPumpNamePath
* parameter:
diff --git a/indra/llcommon/llfile.cpp b/indra/llcommon/llfile.cpp
index 259187c52f..aabc195ba8 100755
--- a/indra/llcommon/llfile.cpp
+++ b/indra/llcommon/llfile.cpp
@@ -807,7 +807,7 @@ std::streamsize llstdio_filebuf::xsgetn(char_type* __s, std::streamsize __n)
return __ret;
}
-std::streamsize llstdio_filebuf::xsputn(char_type* __s, std::streamsize __n)
+std::streamsize llstdio_filebuf::xsputn(const char_type* __s, std::streamsize __n)
{
// Optimization in the always_noconv() case, to be generalized in the
// future: when __n is sufficiently large we write directly instead of
diff --git a/indra/llcommon/llfile.h b/indra/llcommon/llfile.h
index f56b22bf9a..0612071d67 100755
--- a/indra/llcommon/llfile.h
+++ b/indra/llcommon/llfile.h
@@ -188,7 +188,7 @@ protected:
/*virtual*/ int sync();
std::streamsize xsgetn(char_type*, std::streamsize);
- std::streamsize xsputn(char_type*, std::streamsize);
+ std::streamsize xsputn(const char_type*, std::streamsize);
#endif
};
diff --git a/indra/llcommon/llframetimer.cpp b/indra/llcommon/llframetimer.cpp
index 1af2cb8afd..1e9920746b 100755
--- a/indra/llcommon/llframetimer.cpp
+++ b/indra/llcommon/llframetimer.cpp
@@ -37,7 +37,6 @@ U64 LLFrameTimer::sTotalTime = 0;
F64 LLFrameTimer::sTotalSeconds = 0.0;
S32 LLFrameTimer::sFrameCount = 0;
U64 LLFrameTimer::sFrameDeltaTime = 0;
-const F64 USEC_PER_SECOND = 1000000.0;
const F64 USEC_TO_SEC_F64 = 0.000001;
// static
diff --git a/indra/llcommon/llhash.h b/indra/llcommon/llhash.h
index c077ebe93f..4b58e81565 100755
--- a/indra/llcommon/llhash.h
+++ b/indra/llcommon/llhash.h
@@ -27,26 +27,7 @@
#ifndef LL_LLHASH_H
#define LL_LLHASH_H
-#include "llpreprocessor.h" // for GCC_VERSION
-
-#if (LL_WINDOWS)
-#include <hash_map>
-#include <algorithm>
-#elif LL_DARWIN || LL_LINUX
-# if GCC_VERSION >= 40300 // gcc 4.3 and up
-# include <backward/hashtable.h>
-# elif GCC_VERSION >= 30400 // gcc 3.4 and up
-# include <ext/hashtable.h>
-# elif __GNUC__ >= 3
-# include <ext/stl_hashtable.h>
-# else
-# include <hashtable.h>
-# endif
-#elif LL_SOLARIS
-#include <ext/hashtable.h>
-#else
-#error Please define your platform.
-#endif
+#include <boost/functional/hash.hpp>
// Warning - an earlier template-based version of this routine did not do
// the correct thing on Windows. Since this is only used to get
@@ -55,17 +36,17 @@
inline size_t llhash( const char * value )
{
-#if LL_WINDOWS
- return stdext::hash_value(value);
-#elif ( (defined _STLPORT_VERSION) || ((LL_LINUX) && (__GNUC__ <= 2)) )
- std::hash<const char *> H;
- return H(value);
-#elif LL_DARWIN || LL_LINUX || LL_SOLARIS
- __gnu_cxx::hash<const char *> H;
- return H(value);
-#else
-#error Please define your platform.
-#endif
+ // boost::hash is defined for std::string and for char, but there's no
+ // special overload for const char*. The lazy approach would be to
+ // instantiate a std::string and take its hash, but that might be more
+ // overhead than our callers want. Or we could use boost::hash_range() --
+ // but that would require a preliminary pass over the value to determine
+ // the end iterator. Instead, use boost::hash_combine() to hash individual
+ // characters.
+ std::size_t seed = 0;
+ for ( ; *value; ++value)
+ boost::hash_combine(seed, *value);
+ return seed;
}
#endif
diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h
index 7aa87fcd0e..c65b05f610 100755
--- a/indra/llcommon/llinitparam.h
+++ b/indra/llcommon/llinitparam.h
@@ -435,7 +435,7 @@ namespace LLInitParam
typedef self_t type_value_t;
TypeValuesHelper(const std::string& val)
- : TypeValuesHelper(val)
+ : base_t(val)
{}
void operator ()(const std::string& name)
@@ -1123,7 +1123,7 @@ namespace LLInitParam
void set(const value_t& val, bool flag_as_provided = true)
{
named_value_t::clearValueName();
- setValue(val);
+ named_value_t::setValue(val);
setProvided(flag_as_provided);
}
@@ -1287,7 +1287,7 @@ namespace LLInitParam
// assign block contents to this param-that-is-a-block
void set(const value_t& val, bool flag_as_provided = true)
{
- setValue(val);
+ named_value_t::setValue(val);
named_value_t::clearValueName();
setProvided(flag_as_provided);
}
@@ -2054,7 +2054,7 @@ namespace LLInitParam
Optional& operator =(const value_t& val)
{
- set(val);
+ super_t::set(val);
return *this;
}
@@ -2084,7 +2084,7 @@ namespace LLInitParam
Mandatory& operator =(const value_t& val)
{
- set(val);
+ super_t::set(val);
return *this;
}
@@ -2120,7 +2120,7 @@ namespace LLInitParam
Multiple& operator =(const container_t& val)
{
- set(val);
+ super_t::set(val);
return *this;
}
diff --git a/indra/llcommon/llpredicate.h b/indra/llcommon/llpredicate.h
index a0e970a799..e6c56a5711 100644
--- a/indra/llcommon/llpredicate.h
+++ b/indra/llcommon/llpredicate.h
@@ -139,9 +139,9 @@ namespace LLPredicate
Rule()
{}
- void require(ENUM e)
+ void require(ENUM e, bool match)
{
- mRule.set(e, require);
+ mRule.set(e, match);
}
void allow(ENUM e)
diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h
index 309165da7f..2c4bcc91f6 100755
--- a/indra/llcommon/llpreprocessor.h
+++ b/indra/llcommon/llpreprocessor.h
@@ -101,6 +101,11 @@
#endif
+#if LL_WINDOWS
+# define LL_THREAD_LOCAL __declspec(thread)
+#else
+# define LL_THREAD_LOCAL __thread
+#endif
// Static linking with apr on windows needs to be declared.
#if LL_WINDOWS && !LL_COMMON_LINK_SHARED
diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp
index 69043dc173..e3e1d0c391 100755
--- a/indra/llcommon/llprocessor.cpp
+++ b/indra/llcommon/llprocessor.cpp
@@ -204,21 +204,6 @@ namespace
return "Unknown";
}
- std::string compute_CPUFamilyName(const char* cpu_vendor, int composed_family)
- {
- const char* intel_string = "GenuineIntel";
- const char* amd_string = "AuthenticAMD";
- if(!strncmp(cpu_vendor, intel_string, strlen(intel_string)))
- {
- return intel_CPUFamilyName(composed_family);
- }
- else if(!strncmp(cpu_vendor, amd_string, strlen(amd_string)))
- {
- return amd_CPUFamilyName(composed_family);
- }
- return "Unknown";
- }
-
std::string compute_CPUFamilyName(const char* cpu_vendor, int family, int ext_family)
{
const char* intel_string = "GenuineIntel";
@@ -793,7 +778,7 @@ private:
setInfo(eFamily, family);
}
- setInfo(eFamilyName, compute_CPUFamilyName(cpuinfo["vendor_id"].c_str(), family));
+ setInfo(eFamilyName, compute_CPUFamilyName(cpuinfo["vendor_id"].c_str(), family, 0));
// setInfo(eExtendedModel, getSysctlInt("machdep.cpu.extmodel"));
// setInfo(eBrandID, getSysctlInt("machdep.cpu.brand"));
diff --git a/indra/llcommon/llrefcount.h b/indra/llcommon/llrefcount.h
index 72011d04a0..3836a9b5fb 100755
--- a/indra/llcommon/llrefcount.h
+++ b/indra/llcommon/llrefcount.h
@@ -151,29 +151,25 @@ private:
* 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();
- }
- inline void intrusive_ptr_add_ref(LLRefCount* p)
- {
- p->ref();
- }
+inline void intrusive_ptr_add_ref(LLThreadSafeRefCount* p)
+{
+ p->ref();
+}
- inline void intrusive_ptr_release(LLRefCount* p)
- {
- p->unref();
- }
-};
+inline void intrusive_ptr_release(LLThreadSafeRefCount* p)
+{
+ 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/llsd.cpp b/indra/llcommon/llsd.cpp
index d8bbb3a74f..57aa7d9c07 100755
--- a/indra/llcommon/llsd.cpp
+++ b/indra/llcommon/llsd.cpp
@@ -789,10 +789,7 @@ namespace
{
inline LLSD::Impl& safe(LLSD::Impl* impl)
{ return LLSD::Impl::safe(impl); }
-
- inline const LLSD::Impl& safe(const LLSD::Impl* impl)
- { return LLSD::Impl::safe(impl); }
-
+
inline ImplMap& makeMap(LLSD::Impl*& var)
{ return safe(var).makeMap(var); }
diff --git a/indra/llcommon/llsdparam.h b/indra/llcommon/llsdparam.h
index 1542f95e68..09f1bdf1e3 100755
--- a/indra/llcommon/llsdparam.h
+++ b/indra/llcommon/llsdparam.h
@@ -106,7 +106,6 @@ private:
Parser::name_stack_t mNameStack;
const LLSD* mCurReadSD;
LLSD* mWriteRootSD;
- LLSD* mCurWriteSD;
};
diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp
index 562fd26658..6ad4a97149 100755
--- a/indra/llcommon/llsdutil.cpp
+++ b/indra/llcommon/llsdutil.cpp
@@ -572,7 +572,7 @@ std::string llsd_matches(const LLSD& prototype, const LLSD& data, const std::str
return match_types(prototype.type(), TypeVector(), data.type(), pfx);
}
-bool llsd_equals(const LLSD& lhs, const LLSD& rhs, unsigned bits)
+bool llsd_equals(const LLSD& lhs, const LLSD& rhs, int bits)
{
// We're comparing strict equality of LLSD representation rather than
// performing any conversions. So if the types aren't equal, the LLSD
diff --git a/indra/llcommon/llsdutil.h b/indra/llcommon/llsdutil.h
index d0b536c39a..99cb79aa54 100755
--- a/indra/llcommon/llsdutil.h
+++ b/indra/llcommon/llsdutil.h
@@ -126,7 +126,7 @@ LL_COMMON_API std::string llsd_matches(const LLSD& prototype, const LLSD& data,
/// Deep equality. If you want to compare LLSD::Real values for approximate
/// equality rather than bitwise equality, pass @a bits as for
/// is_approx_equal_fraction().
-LL_COMMON_API bool llsd_equals(const LLSD& lhs, const LLSD& rhs, unsigned bits=-1);
+LL_COMMON_API bool llsd_equals(const LLSD& lhs, const LLSD& rhs, int bits=-1);
// Simple function to copy data out of input & output iterators if
// there is no need for casting.
diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp
index 76979f29f6..617969ab2a 100755
--- a/indra/llcommon/llstring.cpp
+++ b/indra/llcommon/llstring.cpp
@@ -1397,7 +1397,7 @@ void LLStringUtilBase<T>::testHarness()
s2.erase( 4, 1 );
llassert( s2 == "hell");
- s2.insert( 0, 'y' );
+ s2.insert( 0, "y" );
llassert( s2 == "yhell");
s2.erase( 1, 3 );
llassert( s2 == "yl");
diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp
index 06e118aa44..1a66612e87 100755
--- a/indra/llcommon/llsys.cpp
+++ b/indra/llcommon/llsys.cpp
@@ -99,8 +99,6 @@ const char MEMINFO_FILE[] = "/proc/meminfo";
extern int errno;
#endif
-
-static const S32 CPUINFO_BUFFER_SIZE = 16383;
LLCPUInfo gSysCPU;
// Don't log memory info any more often than this. It also serves as our
@@ -672,8 +670,6 @@ const std::string& LLOSInfo::getOSVersionString() const
return mOSVersionString;
}
-const S32 STATUS_SIZE = 8192;
-
//static
U32 LLOSInfo::getProcessVirtualSizeKB()
{
@@ -681,6 +677,7 @@ U32 LLOSInfo::getProcessVirtualSizeKB()
#if LL_WINDOWS
#endif
#if LL_LINUX
+# define STATUS_SIZE 2048
LLFILE* status_filep = LLFile::fopen("/proc/self/status", "rb");
if (status_filep)
{
diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp
index 51c89e1eaf..c3f235c6ee 100755
--- a/indra/llcommon/llthread.cpp
+++ b/indra/llcommon/llthread.cpp
@@ -92,13 +92,7 @@ void set_thread_name( DWORD dwThreadID, const char* threadName)
//
//----------------------------------------------------------------------------
-#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 LL_THREAD_LOCAL sThreadID = 0;
U32 LLThread::sIDIter = 0;
@@ -115,9 +109,7 @@ LL_COMMON_API void assert_main_thread()
void LLThread::registerThreadID()
{
-#if !LL_DARWIN
sThreadID = ++sIDIter;
-#endif
}
//
@@ -134,9 +126,7 @@ void *APR_THREAD_FUNC LLThread::staticRun(apr_thread_t *apr_threadp, void *datap
// 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
// Run the user supplied function
threadp->run();
@@ -347,13 +337,7 @@ 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
diff --git a/indra/llcommon/llthreadlocalstorage.h b/indra/llcommon/llthreadlocalstorage.h
index ec3b52c8cb..3b5786023f 100644
--- a/indra/llcommon/llthreadlocalstorage.h
+++ b/indra/llcommon/llthreadlocalstorage.h
@@ -130,56 +130,19 @@ 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
+ static LL_THREAD_LOCAL DERIVED_TYPE* sInstance;
};
-#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
+LL_THREAD_LOCAL DERIVED_TYPE* LLThreadLocalSingletonPointer<DERIVED_TYPE>::sInstance = NULL;
#endif // LL_LLTHREADLOCALSTORAGE_H
diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp
index ab105a82e6..76e892212a 100755
--- a/indra/llcommon/lltimer.cpp
+++ b/indra/llcommon/lltimer.cpp
@@ -39,14 +39,10 @@
# error "architecture not supported"
#endif
-
//
// Locally used constants
//
-const F64 SEC_TO_MICROSEC = 1000000.f;
const U64 SEC_TO_MICROSEC_U64 = 1000000;
-const F64 USEC_TO_SEC_F64 = 0.000001;
-
//---------------------------------------------------------------------------
// Globals and statics
diff --git a/indra/llcommon/lltraceaccumulators.h b/indra/llcommon/lltraceaccumulators.h
index 42fad8a793..6f27b97dff 100644
--- a/indra/llcommon/lltraceaccumulators.h
+++ b/indra/llcommon/lltraceaccumulators.h
@@ -62,11 +62,11 @@ namespace LLTrace
{}
public:
-
- AccumulatorBuffer(const AccumulatorBuffer& other = *getDefaultBuffer())
- : mStorageSize(0),
+ AccumulatorBuffer()
+ : mStorageSize(0),
mStorage(NULL)
{
+ const AccumulatorBuffer& other = *getDefaultBuffer();
resize(sNextStorageSlot);
for (S32 i = 0; i < sNextStorageSlot; i++)
{
@@ -93,6 +93,18 @@ namespace LLTrace
return mStorage[index];
}
+
+ AccumulatorBuffer(const AccumulatorBuffer& other)
+ : mStorageSize(0),
+ mStorage(NULL)
+ {
+ resize(sNextStorageSlot);
+ for (S32 i = 0; i < sNextStorageSlot; i++)
+ {
+ mStorage[i] = other.mStorage[i];
+ }
+ }
+
void addSamples(const AccumulatorBuffer<ACCUMULATOR>& other, EBufferAppendType append_type)
{
llassert(mStorageSize >= sNextStorageSlot && other.mStorageSize >= sNextStorageSlot);
diff --git a/indra/llcommon/llunittype.h b/indra/llcommon/llunittype.h
index 0e05ecd683..ac8504ca61 100644
--- a/indra/llcommon/llunittype.h
+++ b/indra/llcommon/llunittype.h
@@ -87,6 +87,40 @@ struct LLUnit
: mValue(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());
+ }
+
+
// unit initialization and conversion
template<typename OTHER_STORAGE_TYPE, typename OTHER_UNITS>
LL_FORCE_INLINE LLUnit(LLUnit<OTHER_STORAGE_TYPE, OTHER_UNITS> other)
@@ -183,38 +217,6 @@ struct LLUnit
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;
};
@@ -269,7 +271,7 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
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();
+ base_t::mValue += base_t::convert(other).value();
}
using base_t::operator -=;
@@ -283,19 +285,19 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
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();
+ base_t::mValue -= base_t::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();
+ return base_t::mValue == base_t::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();
+ return base_t::mValue == base_t::convert(other).value();
}
template<typename STORAGE_T>
@@ -313,7 +315,7 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
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();
+ return base_t::mValue != base_t::convert(other).value();
}
template<typename STORAGE_T>
@@ -325,13 +327,13 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
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();
+ return base_t::mValue < base_t::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();
+ return base_t::mValue < base_t::convert(other).value();
}
template<typename STORAGE_T>
@@ -343,13 +345,13 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
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();
+ return base_t::mValue <= base_t::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();
+ return base_t::mValue <= base_t::convert(other).value();
}
template<typename STORAGE_T>
@@ -361,13 +363,13 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
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();
+ return base_t::mValue > base_t::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();
+ return base_t::mValue > base_t::convert(other).value();
}
template<typename STORAGE_T>
@@ -379,13 +381,13 @@ struct LLUnitImplicit : public LLUnit<STORAGE_TYPE, UNITS>
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();
+ return base_t::mValue >= base_t::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();
+ return base_t::mValue >= base_t::convert(other).value();
}
template<typename STORAGE_T>
diff --git a/indra/llcommon/stringize.h b/indra/llcommon/stringize.h
index 2df008febb..a5a90d7297 100755
--- a/indra/llcommon/stringize.h
+++ b/indra/llcommon/stringize.h
@@ -30,7 +30,7 @@
#define LL_STRINGIZE_H
#include <sstream>
-#include <boost/lambda/lambda.hpp>
+#include <boost/phoenix/phoenix.hpp>
#include <llstring.h>
/**
@@ -108,7 +108,7 @@ std::string stringize_f(Functor const & f)
* return out.str();
* @endcode
*/
-#define STRINGIZE(EXPRESSION) (stringize_f(boost::lambda::_1 << EXPRESSION))
+#define STRINGIZE(EXPRESSION) (stringize_f(boost::phoenix::placeholders::arg1 << EXPRESSION))
/**
@@ -144,7 +144,7 @@ void destringize_f(std::string const & str, Functor const & f)
* in >> item1 >> item2 >> item3 ... ;
* @endcode
*/
-#define DESTRINGIZE(STR, EXPRESSION) (destringize_f((STR), (boost::lambda::_1 >> EXPRESSION)))
+#define DESTRINGIZE(STR, EXPRESSION) (destringize_f((STR), (boost::phoenix::placeholders::arg1 >> EXPRESSION)))
#endif /* ! defined(LL_STRINGIZE_H) */
diff --git a/indra/llcommon/tests/lldependencies_test.cpp b/indra/llcommon/tests/lldependencies_test.cpp
index 5395d785b6..b5e189a465 100755
--- a/indra/llcommon/tests/lldependencies_test.cpp
+++ b/indra/llcommon/tests/lldependencies_test.cpp
@@ -37,29 +37,14 @@
// associated header
#include "../lldependencies.h"
// other Linden headers
-#include "../test/lltut.h"
-
-using boost::assign::list_of;
#if LL_WINDOWS
#pragma warning (disable : 4675) // "resolved by ADL" -- just as I want!
#endif
-typedef LLDependencies<> StringDeps;
-typedef StringDeps::KeyList StringList;
-
-// We use the very cool boost::assign::list_of() construct to specify vectors
-// of strings inline. For reasons on which I'm not entirely clear, though, it
-// needs a helper function. You can use list_of() to construct an implicit
-// StringList (std::vector<std::string>) by conversion, e.g. for a function
-// parameter -- but if you simply write StringList(list_of("etc.")), you get
-// ambiguity errors. Shrug!
-template<typename CONTAINER>
-CONTAINER make(const CONTAINER& data)
-{
- return data;
-}
-
+/*****************************************************************************
+* Display helpers: must be defined BEFORE lltut.h!
+*****************************************************************************/
// Display an arbitary value as itself...
template<typename T>
std::ostream& display(std::ostream& out, const T& value)
@@ -113,6 +98,31 @@ std::ostream& operator<<(std::ostream& out, const std::set<ENTRY>& set)
return out;
}
+/*****************************************************************************
+* Now we can #include lltut.h
+*****************************************************************************/
+#include "../test/lltut.h"
+
+/*****************************************************************************
+* Other helpers
+*****************************************************************************/
+using boost::assign::list_of;
+
+typedef LLDependencies<> StringDeps;
+typedef StringDeps::KeyList StringList;
+
+// We use the very cool boost::assign::list_of() construct to specify vectors
+// of strings inline. For reasons on which I'm not entirely clear, though, it
+// needs a helper function. You can use list_of() to construct an implicit
+// StringList (std::vector<std::string>) by conversion, e.g. for a function
+// parameter -- but if you simply write StringList(list_of("etc.")), you get
+// ambiguity errors. Shrug!
+template<typename CONTAINER>
+CONTAINER make(const CONTAINER& data)
+{
+ return data;
+}
+
const std::string& extract_key(const LLDependencies<>::value_type& entry)
{
return entry.first;
diff --git a/indra/llcommon/tests/llerror_test.cpp b/indra/llcommon/tests/llerror_test.cpp
index a5aaff10c5..f51279e817 100755
--- a/indra/llcommon/tests/llerror_test.cpp
+++ b/indra/llcommon/tests/llerror_test.cpp
@@ -38,6 +38,9 @@
namespace
{
+#ifdef __clang__
+# pragma clang diagnostic ignored "-Wunused-function"
+#endif
void test_that_error_h_includes_enough_things_to_compile_a_message()
{
LL_INFOS() << "!" << LL_ENDL;
@@ -381,8 +384,6 @@ namespace
};
std::string logFromNamespace(bool id) { return Foo::logFromNamespace(id); }
- std::string logFromClassWithNoLogTypeMember(bool id) { ClassWithNoLogType c; return c.logFromMember(id); }
- std::string logFromClassWithNoLogTypeStatic(bool id) { return ClassWithNoLogType::logFromStatic(id); }
std::string logFromClassWithLogTypeMember(bool id) { ClassWithLogType c; return c.logFromMember(id); }
std::string logFromClassWithLogTypeStatic(bool id) { return ClassWithLogType::logFromStatic(id); }
@@ -393,8 +394,8 @@ namespace
if (n1 == std::string::npos)
{
std::stringstream ss;
- ss << message << ": " << "expected to find a copy of " << expected
- << " in actual " << actual;
+ ss << message << ": " << "expected to find a copy of '" << expected
+ << "' in actual '" << actual << "'";
throw tut::failure(ss.str().c_str());
}
}
@@ -435,9 +436,6 @@ namespace tut
testLogName(mRecorder, logFromStatic);
testLogName(mRecorder, logFromAnon);
testLogName(mRecorder, logFromNamespace);
- //testLogName(mRecorder, logFromClassWithNoLogTypeMember, "ClassWithNoLogType");
- //testLogName(mRecorder, logFromClassWithNoLogTypeStatic, "ClassWithNoLogType");
- // XXX: figure out what the exepcted response is for these
testLogName(mRecorder, logFromClassWithLogTypeMember, "ClassWithLogType");
testLogName(mRecorder, logFromClassWithLogTypeStatic, "ClassWithLogType");
}
@@ -457,11 +455,6 @@ namespace
return "bar";
}
- void uberLogger()
- {
- LL_INFOS() << "uber(" << outerLogger() << "," << innerLogger() << ")" << LL_ENDL;
- }
-
class LogWhileLogging
{
public:
@@ -494,17 +487,10 @@ namespace tut
ensure_message_contains(1, "outside(moo)");
ensure_message_count(2);
- uberLogger();
- ensure_message_contains(2, "inside");
- ensure_message_contains(3, "inside");
- ensure_message_contains(4, "outside(moo)");
- ensure_message_contains(5, "uber(bar,moo)");
- ensure_message_count(6);
-
metaLogger();
- ensure_message_contains(6, "logging");
- ensure_message_contains(7, "meta(baz)");
- ensure_message_count(8);
+ ensure_message_contains(2, "logging");
+ ensure_message_contains(3, "meta(baz)");
+ ensure_message_count(4);
}
template<> template<>
diff --git a/indra/llcommon/tests/lleventcoro_test.cpp b/indra/llcommon/tests/lleventcoro_test.cpp
index cb5e15eff2..2096807e53 100755
--- a/indra/llcommon/tests/lleventcoro_test.cpp
+++ b/indra/llcommon/tests/lleventcoro_test.cpp
@@ -94,7 +94,6 @@ using coroutines::coroutine;
template<typename Iter>
bool match(Iter first, Iter last, std::string match) {
std::string::iterator i = match.begin();
- i != match.end();
for(; (first != last) && (i != match.end()); ++i) {
if (*first != *i)
return false;
diff --git a/indra/llcommon/tests/llframetimer_test.cpp b/indra/llcommon/tests/llframetimer_test.cpp
index 8ac1c91a3a..be372bb855 100755
--- a/indra/llcommon/tests/llframetimer_test.cpp
+++ b/indra/llcommon/tests/llframetimer_test.cpp
@@ -84,25 +84,34 @@ namespace tut
template<> template<>
void frametimer_object_t::test<3>()
{
+ clock_t t1 = clock();
+ ms_sleep(200);
+ clock_t t2 = clock();
+ clock_t elapsed = t2 - t1 + 1;
+ std::cout << "Note: using clock(), ms_sleep() actually took " << (long)elapsed << "ms" << std::endl;
+
F64 seconds_since_epoch = LLFrameTimer::getTotalSeconds();
seconds_since_epoch += 2.0;
LLFrameTimer timer;
timer.setExpiryAt(seconds_since_epoch);
- ensure("timer not expired on create", !timer.hasExpired());
- int ii;
- for(ii = 0; ii < 10; ++ii)
+ /*
+ * Note that the ms_sleep(200) below is only guaranteed to return
+ * in 200ms _or_more_, so it should be true that by the 10th
+ * iteration we've gotten to the 2 seconds requested above
+ * and the timer should expire, but it can expire in fewer iterations
+ * if one or more of the ms_sleep calls takes longer.
+ * (as it did when we moved to Mac OS X 10.10)
+ */
+ int iterations_until_expiration = 0;
+ while ( !timer.hasExpired() )
{
- ms_sleep(150);
- LLFrameTimer::updateFrameTime();
- }
- ensure("timer not expired after a bit", !timer.hasExpired());
- for(ii = 0; ii < 10; ++ii)
- {
- ms_sleep(100);
- LLFrameTimer::updateFrameTime();
+ ms_sleep(200);
+ LLFrameTimer::updateFrameTime();
+ iterations_until_expiration++;
}
- ensure("timer expired", timer.hasExpired());
+ ensure("timer took too long to expire", iterations_until_expiration <= 10);
}
+
/*
template<> template<>
void frametimer_object_t::test<4>()
diff --git a/indra/llcommon/tests/llleap_test.cpp b/indra/llcommon/tests/llleap_test.cpp
index 9ea822cb8d..2d88e2c676 100755
--- a/indra/llcommon/tests/llleap_test.cpp
+++ b/indra/llcommon/tests/llleap_test.cpp
@@ -17,7 +17,7 @@
// std headers
// external library headers
#include <boost/assign/list_of.hpp>
-#include <boost/lambda/lambda.hpp>
+#include <boost/phoenix/core/argument.hpp>
#include <boost/foreach.hpp>
// other Linden headers
#include "../test/lltut.h"
@@ -38,24 +38,7 @@ StringVec sv(const StringVec& listof) { return listof; }
#define sleep(secs) _sleep((secs) * 1000)
#endif
-#if ! LL_WINDOWS
const size_t BUFFERED_LENGTH = 1023*1024; // try wrangling just under a megabyte of data
-#else
-// "Then there's Windows... sigh." The "very large message" test is flaky in a
-// way that seems to point to either the OS (nonblocking writes to pipes) or
-// possibly the apr_file_write() function. Poring over log messages reveals
-// that at some point along the way apr_file_write() returns 11 (Resource
-// temporarily unavailable, i.e. EAGAIN) and says it wrote 0 bytes -- even
-// though it did write the chunk! Our next write attempt retries the same
-// chunk, resulting in the chunk being duplicated at the child end, corrupting
-// the data stream. Much as I would love to be able to fix it for real, such a
-// fix would appear to require distinguishing bogus EAGAIN returns from real
-// ones -- how?? Empirically this behavior is only observed when writing a
-// "very large message". To be able to move forward at all, try to bypass this
-// particular failure by adjusting the size of a "very large message" on
-// Windows.
-const size_t BUFFERED_LENGTH = 65336;
-#endif // LL_WINDOWS
void waitfor(const std::vector<LLLeap*>& instances, int timeout=60)
{
@@ -109,7 +92,7 @@ namespace tut
llleap_data():
reader(".py",
// This logic is adapted from vita.viewerclient.receiveEvent()
- boost::lambda::_1 <<
+ boost::phoenix::placeholders::arg1 <<
"import re\n"
"import os\n"
"import sys\n"
@@ -403,7 +386,7 @@ namespace tut
AckAPI api;
Result result;
NamedTempFile script("py",
- boost::lambda::_1 <<
+ boost::phoenix::placeholders::arg1 <<
"from " << reader_module << " import *\n"
// make a request on our little API
"request(pump='" << api.getName() << "', data={})\n"
@@ -441,7 +424,7 @@ namespace tut
ReqIDAPI api;
Result result;
NamedTempFile script("py",
- boost::lambda::_1 <<
+ boost::phoenix::placeholders::arg1 <<
"import sys\n"
"from " << reader_module << " import *\n"
// Note that since reader imports llsd, this
@@ -484,7 +467,7 @@ namespace tut
ReqIDAPI api;
Result result;
NamedTempFile script("py",
- boost::lambda::_1 <<
+ boost::phoenix::placeholders::arg1 <<
"import sys\n"
"from " << reader_module << " import *\n"
// Generate a very large string value.
diff --git a/indra/llcommon/tests/llprocess_test.cpp b/indra/llcommon/tests/llprocess_test.cpp
index e4e766d51b..5ba343b183 100755
--- a/indra/llcommon/tests/llprocess_test.cpp
+++ b/indra/llcommon/tests/llprocess_test.cpp
@@ -85,7 +85,7 @@ static std::string readfile(const std::string& pathname, const std::string& desc
}
std::ifstream inf(pathname.c_str());
std::string output;
- tut::ensure(STRINGIZE("No output " << use_desc), std::getline(inf, output));
+ tut::ensure(STRINGIZE("No output " << use_desc), bool(std::getline(inf, output)));
std::string more;
while (std::getline(inf, more))
{
@@ -154,7 +154,7 @@ struct PythonProcessLauncher
void launch()
{
mPy = LLProcess::create(mParams);
- tut::ensure(STRINGIZE("Couldn't launch " << mDesc << " script"), mPy);
+ tut::ensure(STRINGIZE("Couldn't launch " << mDesc << " script"), bool(mPy));
}
/// Run Python script and wait for it to complete.
@@ -873,7 +873,7 @@ namespace tut
std::string threw; \
/* Both the following calls should work. */ \
(PROCESS).GETPIPE(VALID); \
- ensure(#GETOPTPIPE "(" #VALID ") failed", (PROCESS).GETOPTPIPE(VALID)); \
+ ensure(#GETOPTPIPE "(" #VALID ") failed", bool((PROCESS).GETOPTPIPE(VALID))); \
/* pass obviously bogus PIPESLOT */ \
CATCH_IN(threw, LLProcess::NoPipe, (PROCESS).GETPIPE(LLProcess::FILESLOT(4))); \
ensure_contains("didn't reject bad slot", threw, "no slot"); \
diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp
index b5893135ea..6fbb9abfc0 100755
--- a/indra/llcommon/tests/llsdserialize_test.cpp
+++ b/indra/llcommon/tests/llsdserialize_test.cpp
@@ -46,9 +46,10 @@ typedef U32 uint32_t;
#include "boost/range.hpp"
#include "boost/foreach.hpp"
#include "boost/function.hpp"
-#include "boost/lambda/lambda.hpp"
-#include "boost/lambda/bind.hpp"
-namespace lambda = boost::lambda;
+#include "boost/bind.hpp"
+#include "boost/phoenix/bind/bind_function.hpp"
+#include "boost/phoenix/core/argument.hpp"
+using namespace boost::phoenix;
#include "../llsd.h"
#include "../llsdserialize.h"
@@ -1612,6 +1613,20 @@ namespace tut
"print 'Running on', sys.platform\n");
}
+ // helper for test<3>
+ static void writeLLSDArray(std::ostream& out, const LLSD& array)
+ {
+ BOOST_FOREACH(LLSD item, llsd::inArray(array))
+ {
+ LLSDSerialize::toNotation(item, out);
+ // It's important to separate with newlines because Python's llsd
+ // module doesn't support parsing from a file stream, only from a
+ // string, so we have to know how much of the file to read into a
+ // string.
+ out << '\n';
+ }
+ }
+
template<> template<>
void TestPythonCompatibleObject::test<3>()
{
@@ -1639,26 +1654,16 @@ namespace tut
" assert False, 'Too many data items'\n";
// Create an llsdXXXXXX file containing 'data' serialized to
- // notation. It's important to separate with newlines because Python's
- // llsd module doesn't support parsing from a file stream, only from a
- // string, so we have to know how much of the file to read into a
- // string.
+ // notation.
NamedTempFile file("llsd",
// NamedTempFile's boost::function constructor
// takes a callable. To this callable it passes the
// std::ostream with which it's writing the
- // NamedTempFile. This lambda-based expression
- // first calls LLSD::Serialize() with that ostream,
- // then streams a newline to it, etc.
- (lambda::bind(LLSDSerialize::toNotation, cdata[0], lambda::_1),
- lambda::_1 << '\n',
- lambda::bind(LLSDSerialize::toNotation, cdata[1], lambda::_1),
- lambda::_1 << '\n',
- lambda::bind(LLSDSerialize::toNotation, cdata[2], lambda::_1),
- lambda::_1 << '\n'));
+ // NamedTempFile.
+ boost::bind(writeLLSDArray, _1, cdata));
python("read C++ notation",
- lambda::_1 <<
+ placeholders::arg1 <<
import_llsd <<
"def parse_each(iterable):\n"
" for item in iterable:\n"
@@ -1679,7 +1684,7 @@ namespace tut
NamedTempFile file("llsd", "");
python("write Python notation",
- lambda::_1 <<
+ placeholders::arg1 <<
"from __future__ import with_statement\n" <<
import_llsd <<
"DATA = [\n"
diff --git a/indra/llcommon/tests/llstring_test.cpp b/indra/llcommon/tests/llstring_test.cpp
index 93d3968dbf..a7aa347222 100755
--- a/indra/llcommon/tests/llstring_test.cpp
+++ b/indra/llcommon/tests/llstring_test.cpp
@@ -27,11 +27,11 @@
*/
#include "linden_common.h"
-#include "../test/lltut.h"
#include <boost/assign/list_of.hpp>
#include "../llstring.h"
-#include "StringVec.h"
+#include "StringVec.h" // must come BEFORE lltut.h
+#include "../test/lltut.h"
using boost::assign::list_of;
diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp
index fbbb1614fb..b9632a7921 100755
--- a/indra/llcorehttp/_httpoprequest.cpp
+++ b/indra/llcorehttp/_httpoprequest.cpp
@@ -104,7 +104,6 @@ char * os_strltrim(char * str);
void os_strlower(char * str);
// Error testing and reporting for libcurl status codes
-void check_curl_easy_code(CURLcode code);
void check_curl_easy_code(CURLcode code, int curl_setopt_option);
static const char * const LOG_CORE("CoreHttp");
@@ -588,9 +587,18 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service)
(mReqLength ? fmt1 : fmt2),
(unsigned long) mReqOffset, (unsigned long) (mReqOffset + mReqLength - 1));
#else
- snprintf(range_line, sizeof(range_line),
- (mReqLength ? fmt1 : fmt2),
- (unsigned long) mReqOffset, (unsigned long) (mReqOffset + mReqLength - 1));
+ if ( mReqLength )
+ {
+ snprintf(range_line, sizeof(range_line),
+ fmt1,
+ (unsigned long) mReqOffset, (unsigned long) (mReqOffset + mReqLength - 1));
+ }
+ else
+ {
+ snprintf(range_line, sizeof(range_line),
+ fmt2,
+ (unsigned long) mReqOffset);
+ }
#endif // LL_WINDOWS
range_line[sizeof(range_line) - 1] = '\0';
mCurlHeaders = curl_slist_append(mCurlHeaders, range_line);
@@ -623,8 +631,23 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service)
// a handwave but bump the transfer timeout up by the pipelining
// depth to give some room.
//
+ // BUG-7698, BUG-7688, BUG-7694 (others). Scylla and Charybdis
+ // situation. Operating against a CDN having service issues may
+ // lead to requests stalling for an arbitrarily long time with only
+ // the CURLOPT_TIMEOUT value leading to a closed connection. Sadly
+ // for pipelining, libcurl (7.39.0 and earlier, at minimum) starts
+ // the clock on this value as soon as a request is started down
+ // the wire. We want a short value to recover and retry from the
+ // CDN. We need a long value to safely deal with a succession of
+ // piled-up pipelined requests.
+ //
// *TODO: Find a better scheme than timeouts to guarantee liveness.
- xfer_timeout *= cpolicy.mPipelining;
+ // Progress on the connection is what we really want, not timeouts.
+ // But we don't have access to that and the request progress indicators
+ // (various libcurl callbacks) have the same problem TIMEOUT does.
+ //
+ // xfer_timeout *= cpolicy.mPipelining;
+ xfer_timeout *= 2L;
}
// *DEBUG: Enable following override for timeout handling and "[curl:bugs] #1420" tests
// xfer_timeout = 1L;
@@ -1136,18 +1159,4 @@ void check_curl_easy_code(CURLcode code, int curl_setopt_option)
}
}
-
-void check_curl_easy_code(CURLcode code)
-{
- if (CURLE_OK != code)
- {
- // Comment from old llcurl code which may no longer apply:
- //
- // linux appears to throw a curl error once per session for a bad initialization
- // at a pretty random time (when enabling cookies).
- LL_WARNS(LOG_CORE) << "libcurl error detected: " << curl_easy_strerror(code)
- << LL_ENDL;
- }
-}
-
} // end anonymous namespace
diff --git a/indra/llcorehttp/bufferstream.cpp b/indra/llcorehttp/bufferstream.cpp
index 6553900eef..678bf5ea9f 100755
--- a/indra/llcorehttp/bufferstream.cpp
+++ b/indra/llcorehttp/bufferstream.cpp
@@ -257,8 +257,6 @@ std::streampos BufferArrayStreamBuf::seekoff(std::streamoff off,
return ret;
}
- if (pos < 0)
- return ret;
if (pos > mBufferArray->size())
{
pos = mBufferArray->size();
diff --git a/indra/llcorehttp/examples/http_texture_load.cpp b/indra/llcorehttp/examples/http_texture_load.cpp
index b76c874557..9d9631b980 100755
--- a/indra/llcorehttp/examples/http_texture_load.cpp
+++ b/indra/llcorehttp/examples/http_texture_load.cpp
@@ -212,7 +212,7 @@ int main(int argc, char** argv)
char * end;
value = strtoul(optarg, &end, 10);
- if (value < 0 || value > 100 || *end != '\0')
+ if (value > 100 || *end != '\0')
{
usage(std::cerr);
return 1;
@@ -227,7 +227,7 @@ int main(int argc, char** argv)
char * end;
value = strtoul(optarg, &end, 10);
- if (value < 0 || value > 3 || *end != '\0')
+ if (value > 3 || *end != '\0')
{
usage(std::cerr);
return 1;
diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp
index d336eeaabc..ecdcd95d29 100755
--- a/indra/llimage/llimage.cpp
+++ b/indra/llimage/llimage.cpp
@@ -1036,13 +1036,13 @@ void LLImageRaw::copyLineScaled( U8* in, U8* out, S32 in_pixel_len, S32 out_pixe
a *= norm_factor; // skip conditional
S32 t4 = x * out_pixel_step * components;
- out[t4 + 0] = U8(llround(r));
+ out[t4 + 0] = U8(ll_round(r));
if (components >= 2)
- out[t4 + 1] = U8(llround(g));
+ out[t4 + 1] = U8(ll_round(g));
if (components >= 3)
- out[t4 + 2] = U8(llround(b));
+ out[t4 + 2] = U8(ll_round(b));
if( components == 4)
- out[t4 + 3] = U8(llround(a));
+ out[t4 + 3] = U8(ll_round(a));
}
}
}
@@ -1117,10 +1117,10 @@ void LLImageRaw::compositeRowScaled4onto3( U8* in, U8* out, S32 in_pixel_len, S3
b *= norm_factor;
a *= norm_factor;
- in_scaled_r = U8(llround(r));
- in_scaled_g = U8(llround(g));
- in_scaled_b = U8(llround(b));
- in_scaled_a = U8(llround(a));
+ in_scaled_r = U8(ll_round(r));
+ in_scaled_g = U8(ll_round(g));
+ in_scaled_b = U8(ll_round(b));
+ in_scaled_a = U8(ll_round(a));
}
if( in_scaled_a )
diff --git a/indra/llimage/llimagefilter.cpp b/indra/llimage/llimagefilter.cpp
index 3d0c488768..0b9d136910 100755
--- a/indra/llimage/llimagefilter.cpp
+++ b/indra/llimage/llimagefilter.cpp
@@ -266,7 +266,7 @@ void LLImageFilter::executeFilter(LLPointer<LLImageRaw> raw_image)
}
else
{
- llwarns << "Filter unknown, cannot execute filter command : " << filter_name << llendl;
+ LL_WARNS() << "Filter unknown, cannot execute filter command : " << filter_name << LL_ENDL;
}
}
}
diff --git a/indra/llkdu/llimagej2ckdu.h b/indra/llkdu/llimagej2ckdu.h
index fb1f6535ba..02281152bf 100755
--- a/indra/llkdu/llimagej2ckdu.h
+++ b/indra/llkdu/llimagej2ckdu.h
@@ -36,7 +36,17 @@
#include "kdu_elementary.h"
#include "kdu_messaging.h"
#include "kdu_params.h"
+
+// don't *really* want to rebuild KDU so turn off specific warnings for this header
+#if LL_DARWIN
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-private-field"
+#include "kdu_compressed.h"
+#pragma clang diagnostic pop
+#else
#include "kdu_compressed.h"
+#endif
+
#include "kdu_sample_processing.h"
class LLKDUDecodeState;
diff --git a/indra/llkdu/llkdumem.h b/indra/llkdu/llkdumem.h
index dbdf88b2d9..fab913d93b 100755
--- a/indra/llkdu/llkdumem.h
+++ b/indra/llkdu/llkdumem.h
@@ -29,7 +29,17 @@
// Support classes for reading and writing from memory buffers in KDU
#define KDU_NO_THREADS
+// don't *really* want to rebuild KDU so turn off specific warnings for this header
+#if LL_DARWIN
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wself-assign-field"
+#pragma clang diagnostic ignored "-Wunused-private-field"
#include "kdu_image.h"
+#pragma clang diagnostic pop
+#else
+#include "kdu_image.h"
+#endif
+
#include "kdu_elementary.h"
#include "kdu_messaging.h"
#include "kdu_params.h"
diff --git a/indra/llkdu/tests/llimagej2ckdu_test.cpp b/indra/llkdu/tests/llimagej2ckdu_test.cpp
index 3f627b65e1..0605fad068 100755
--- a/indra/llkdu/tests/llimagej2ckdu_test.cpp
+++ b/indra/llkdu/tests/llimagej2ckdu_test.cpp
@@ -28,7 +28,16 @@
#include "linden_common.h"
// Class to test
#include "llimagej2ckdu.h"
+
+#if LL_DARWIN
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-private-field"
+#include "llkdumem.h"
+#pragma clang diagnostic pop
+#else
#include "llkdumem.h"
+#endif
+
#include "kdu_block_coding.h"
// Tut header
#include "lltut.h"
@@ -114,7 +123,6 @@ kdu_block_encoder::kdu_block_encoder() { }
kdu_block_decoder::kdu_block_decoder() { }
void kdu_block::set_max_passes(int , bool ) { }
void kdu_block::set_max_bytes(int , bool ) { }
-void kdu_block::set_max_samples(int ) { }
void kdu_tile::close(kdu_thread_env* ) { }
int kdu_tile::get_num_components() { return 0; }
bool kdu_tile::get_ycc() { return false; }
@@ -157,7 +165,7 @@ void kdu_codestream::get_valid_tiles(kdu_dims& ) { }
void kdu_codestream::create(kdu_compressed_source*, kdu_thread_env*) { }
void kdu_codestream::apply_input_restrictions( int, int, int, int, kdu_dims*, kdu_component_access_mode ) { }
void kdu_codestream::get_subsampling(int , kdu_coords&, bool ) { }
-void kdu_codestream::flush(kdu_long *, int , kdu_uint16 *, bool, bool, double, kdu_thread_env*) { }
+void kdu_codestream::flush(kdu_long *, int, kdu_uint16 *, bool, bool, double, kdu_thread_env*, int) { }
void kdu_codestream::set_resilient(bool ) { }
int kdu_codestream::get_num_components(bool ) { return 0; }
kdu_long kdu_codestream::get_total_bytes(bool ) { return 0; }
@@ -175,8 +183,7 @@ kdu_block* kdu_subband::open_block(kdu_coords, int*, kdu_thread_env*) { return N
bool kdu_codestream_comment::put_text(const char*) { return false; }
void kdu_customize_warnings(kdu_message*) { }
void kdu_customize_errors(kdu_message*) { }
-
-kdu_long kdu_multi_analysis::create(kdu_codestream, kdu_tile, bool, kdu_roi_image*, bool, int, kdu_thread_env*, kdu_thread_queue*, bool ) { kdu_long a = 0; return a; }
+kdu_long kdu_multi_analysis::create(kdu_codestream, kdu_tile, kdu_thread_env*, kdu_thread_queue*, int, kdu_roi_image*, int) { kdu_long a = 0; return a; }
siz_params::siz_params() : kdu_params(NULL, false, false, false, false, false) { }
void siz_params::finalize(bool ) { }
void siz_params::copy_with_xforms(kdu_params*, int, int, bool, bool, bool) { }
@@ -184,20 +191,12 @@ int siz_params::write_marker_segment(kdu_output*, kdu_params*, int) { return 0;
bool siz_params::check_marker_segment(kdu_uint16, int, kdu_byte a[], int&) { return false; }
bool siz_params::read_marker_segment(kdu_uint16, int, kdu_byte a[], int) { return false; }
-#ifdef LL_LINUX
-// Linux use the old pre KDU v7.0.0
-// *TODO: Supress this legacy stubbs once Linux migrates to v7.0.0
-kdu_decoder::kdu_decoder(kdu_subband , kdu_sample_allocator*, bool , float, int, kdu_thread_env*, kdu_thread_queue*) { }
-void kdu_codestream::create(siz_params*, kdu_compressed_target*, kdu_dims*, int, kdu_long ) { }
-void kdu_convert_ycc_to_rgb(kdu_line_buf&, kdu_line_buf&, kdu_line_buf&, int) { }
-#else
kdu_decoder::kdu_decoder(kdu_subband , kdu_sample_allocator*, bool , float, int, kdu_thread_env*, kdu_thread_queue*, int) { }
void kdu_codestream::create(siz_params*, kdu_compressed_target*, kdu_dims*, int, kdu_long, kdu_thread_env* ) { }
void (*kdu_convert_ycc_to_rgb_rev16)(kdu_int16*,kdu_int16*,kdu_int16*,int);
void (*kdu_convert_ycc_to_rgb_irrev16)(kdu_int16*,kdu_int16*,kdu_int16*,int);
void (*kdu_convert_ycc_to_rgb_rev32)(kdu_int32*,kdu_int32*,kdu_int32*,int);
void (*kdu_convert_ycc_to_rgb_irrev32)(float*,float*,float*,int);
-#endif
// -------------------------------------------------------------------------------------------
// TUT
diff --git a/indra/llmath/llline.cpp b/indra/llmath/llline.cpp
index f26231840b..cfee315b55 100755
--- a/indra/llmath/llline.cpp
+++ b/indra/llmath/llline.cpp
@@ -30,7 +30,6 @@
#include "llline.h"
#include "llrand.h"
-const F32 SOME_SMALL_NUMBER = 1.0e-5f;
const F32 SOME_VERY_SMALL_NUMBER = 1.0e-8f;
LLLine::LLLine()
diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h
index a8b27ad189..93b9f22b25 100755
--- a/indra/llmath/llmath.h
+++ b/indra/llmath/llmath.h
@@ -206,16 +206,16 @@ inline S32 llceil( F32 f )
#ifndef BOGUS_ROUND
// Use this round. Does an arithmetic round (0.5 always rounds up)
-inline S32 llround(const F32 val)
+inline S32 ll_round(const F32 val)
{
return llfloor(val + 0.5f);
}
#else // BOGUS_ROUND
-// Old llround implementation - does banker's round (toward nearest even in the case of a 0.5.
+// Old ll_round implementation - does banker's round (toward nearest even in the case of a 0.5.
// Not using this because we don't have a consistent implementation on both platforms, use
// llfloor(val + 0.5f), which is consistent on all platforms.
-inline S32 llround(const F32 val)
+inline S32 ll_round(const F32 val)
{
#if LL_WINDOWS
// Note: assumes that the floating point control word is set to rounding mode (the default)
@@ -254,12 +254,12 @@ inline int round_int(double x)
}
#endif // BOGUS_ROUND
-inline F32 llround( F32 val, F32 nearest )
+inline F32 ll_round( F32 val, F32 nearest )
{
return F32(floor(val * (1.0f / nearest) + 0.5f)) * nearest;
}
-inline F64 llround( F64 val, F64 nearest )
+inline F64 ll_round( F64 val, F64 nearest )
{
return F64(floor(val * (1.0 / nearest) + 0.5)) * nearest;
}
@@ -309,25 +309,6 @@ const S32 LL_SHIFT_AMOUNT = 16; //16.16 fixed point represe
#define LL_MAN_INDEX 1
#endif
-/* Deprecated: use llround(), lltrunc(), or llfloor() instead
-// ================================================================================================
-// Real2Int
-// ================================================================================================
-inline S32 F64toS32(F64 val)
-{
- val = val + LL_DOUBLE_TO_FIX_MAGIC;
- return ((S32*)&val)[LL_MAN_INDEX] >> LL_SHIFT_AMOUNT;
-}
-
-// ================================================================================================
-// Real2Int
-// ================================================================================================
-inline S32 F32toS32(F32 val)
-{
- return F64toS32 ((F64)val);
-}
-*/
-
////////////////////////////////////////////////
//
// Fast exp and log
@@ -351,9 +332,7 @@ static union
#define LL_EXP_A (1048576 * OO_LN2) // use 1512775 for integer
#define LL_EXP_C (60801) // this value of C good for -4 < y < 4
-#define LL_FAST_EXP(y) (LLECO.n.i = llround(F32(LL_EXP_A*(y))) + (1072693248 - LL_EXP_C), LLECO.d)
-
-
+#define LL_FAST_EXP(y) (LLECO.n.i = ll_round(F32(LL_EXP_A*(y))) + (1072693248 - LL_EXP_C), LLECO.d)
inline F32 llfastpow(const F32 x, const F32 y)
{
@@ -370,9 +349,6 @@ inline F32 snap_to_sig_figs(F32 foo, S32 sig_figs)
bar *= 10.f;
}
- //F32 new_foo = (F32)llround(foo * bar);
- // the llround() implementation sucks. Don't us it.
-
F32 sign = (foo > 0.f) ? 1.f : -1.f;
F32 new_foo = F32( S64(foo * bar + sign * 0.5f));
new_foo /= bar;
diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h
index 7b5240c651..280d2653d3 100755
--- a/indra/llmath/lloctree.h
+++ b/indra/llmath/lloctree.h
@@ -322,7 +322,7 @@ public:
//is it here?
if (isInside(data->getPositionGroup()))
{
- if (((getElementCount() < gOctreeMaxCapacity || getSize()[0] <= gOctreeMinSize) && 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);
@@ -445,7 +445,7 @@ public:
mDataEnd = &mData[0];
}
- notifyRemoval(data);
+ this->notifyRemoval(data);
checkAlive();
}
@@ -711,7 +711,7 @@ public:
//(don't notify listeners of addition)
for (U32 i = 0; i < child->getChildCount(); i++)
{
- addChild(child->getChild(i), TRUE);
+ this->addChild(child->getChild(i), TRUE);
}
//destroy child
@@ -755,10 +755,10 @@ public:
return false;
}
- if (this->getSize()[0] > data->getBinRadius() && isInside(data->getPositionGroup()))
+ if (this->getSize()[0] > data->getBinRadius() && this->isInside(data->getPositionGroup()))
{
//we got it, just act like a branch
- oct_node* node = getNodeAt(data);
+ oct_node* node = this->getNodeAt(data);
if (node == this)
{
LLOctreeNode<T>::insert(data);
@@ -771,7 +771,7 @@ public:
else if (this->getChildCount() == 0)
{
//first object being added, just wrap it up
- while (!(this->getSize()[0] > data->getBinRadius() && isInside(data->getPositionGroup())))
+ while (!(this->getSize()[0] > data->getBinRadius() && this->isInside(data->getPositionGroup())))
{
LLVector4a center, size;
center = this->getCenter();
@@ -786,7 +786,7 @@ public:
}
else
{
- while (!(this->getSize()[0] > data->getBinRadius() && isInside(data->getPositionGroup())))
+ while (!(this->getSize()[0] > data->getBinRadius() && this->isInside(data->getPositionGroup())))
{
//the data is outside the root node, we need to grow
LLVector4a center(this->getCenter());
@@ -814,7 +814,7 @@ public:
//clear our children and add the root copy
this->clearChildren();
- addChild(newnode);
+ this->addChild(newnode);
}
//insert the data
diff --git a/indra/llmath/llquantize.h b/indra/llmath/llquantize.h
index 1595dbecf8..10c950abbb 100755
--- a/indra/llmath/llquantize.h
+++ b/indra/llmath/llquantize.h
@@ -52,7 +52,7 @@ inline U16 F32_to_U16_ROUND(F32 val, F32 lower, F32 upper)
val /= (upper - lower);
// round the value. Sreturn the U16
- return (U16)(llround(val*U16MAX));
+ return (U16)(ll_round(val*U16MAX));
}
@@ -92,7 +92,7 @@ inline U8 F32_to_U8_ROUND(F32 val, F32 lower, F32 upper)
val /= (upper - lower);
// return the rounded U8
- return (U8)(llround(val*U8MAX));
+ return (U8)(ll_round(val*U8MAX));
}
diff --git a/indra/llmath/llquaternion.h b/indra/llmath/llquaternion.h
index e56929ed0f..aa0b1752f4 100755
--- a/indra/llmath/llquaternion.h
+++ b/indra/llmath/llquaternion.h
@@ -71,6 +71,9 @@ public:
void quantize8(F32 lower, F32 upper); // changes the vector to reflect quatization
void loadIdentity(); // Loads the quaternion that represents the identity rotation
+ bool isEqualEps(const LLQuaternion &quat, F32 epsilon) const;
+ bool isNotEqualEps(const LLQuaternion &quat, F32 epsilon) const;
+
const LLQuaternion& set(F32 x, F32 y, F32 z, F32 w); // Sets Quaternion to normalize(x, y, z, w)
const LLQuaternion& set(const LLQuaternion &quat); // Copies Quaternion
const LLQuaternion& set(const F32 *q); // Sets Quaternion to normalize(quat[VX], quat[VY], quat[VZ], quat[VW])
@@ -239,6 +242,21 @@ inline void LLQuaternion::loadIdentity()
mQ[VW] = 1.0f;
}
+inline bool LLQuaternion::isEqualEps(const LLQuaternion &quat, F32 epsilon) const
+{
+ return ( fabs(mQ[VX] - quat.mQ[VX]) < epsilon
+ && fabs(mQ[VY] - quat.mQ[VY]) < epsilon
+ && fabs(mQ[VZ] - quat.mQ[VZ]) < epsilon
+ && fabs(mQ[VS] - quat.mQ[VS]) < epsilon );
+}
+
+inline bool LLQuaternion::isNotEqualEps(const LLQuaternion &quat, F32 epsilon) const
+{
+ return ( fabs(mQ[VX] - quat.mQ[VX]) > epsilon
+ || fabs(mQ[VY] - quat.mQ[VY]) > epsilon
+ || fabs(mQ[VZ] - quat.mQ[VZ]) > epsilon
+ || fabs(mQ[VS] - quat.mQ[VS]) > epsilon );
+}
inline const LLQuaternion& LLQuaternion::set(F32 x, F32 y, F32 z, F32 w)
{
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index d9a68cb577..dedd90eab2 100755
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -56,8 +56,6 @@
#define DEBUG_SILHOUETTE_NORMALS 0 // TomY: Use this to display normals using the silhouette
#define DEBUG_SILHOUETTE_EDGE_MAP 0 // DaveP: Use this to display edge map using the silhouette
-const F32 CUT_MIN = 0.f;
-const F32 CUT_MAX = 1.f;
const F32 MIN_CUT_DELTA = 0.02f;
const F32 HOLLOW_MIN = 0.f;
@@ -560,7 +558,7 @@ void LLProfile::genNGon(const LLProfileParams& params, S32 sides, F32 offset, F3
// Scale to have size "match" scale. Compensates to get object to generally fill bounding box.
- S32 total_sides = llround(sides / ang_scale); // Total number of sides all around
+ S32 total_sides = ll_round(sides / ang_scale); // Total number of sides all around
if (total_sides < 8)
{
@@ -2076,7 +2074,7 @@ LLVolume::LLVolume(const LLVolumeParams &params, const F32 detail, const BOOL ge
generate();
- if (mParams.getSculptID().isNull() && mParams.getSculptType() == LL_SCULPT_TYPE_NONE || mParams.getSculptType() == LL_SCULPT_TYPE_MESH)
+ if ((mParams.getSculptID().isNull() && mParams.getSculptType() == LL_SCULPT_TYPE_NONE) || mParams.getSculptType() == LL_SCULPT_TYPE_MESH)
{
createVolumeFaces();
}
@@ -4027,7 +4025,6 @@ LLVertexIndexPair::LLVertexIndexPair(const LLVector3 &vertex, const S32 index)
}
const F32 VERTEX_SLOP = 0.00001f;
-const F32 VERTEX_SLOP_SQRD = VERTEX_SLOP * VERTEX_SLOP;
struct lessVertex
{
@@ -4914,9 +4911,7 @@ F64 find_vertex_score(LLVCacheVertexData& data)
{
F64 score = -1.0;
- if (data.mActiveTriangles >= 0)
- {
- score = 0.0;
+ score = 0.0;
S32 cache_idx = data.mCacheTag;
@@ -4938,9 +4933,8 @@ F64 find_vertex_score(LLVCacheVertexData& data)
}
//bonus points for having low valence
- F64 valence_boost = pow((F64)data.mActiveTriangles, -FindVertexScore_ValenceBoostPower);
+ F64 valence_boost = pow((F64)data.mActiveTriangles, -FindVertexScore_ValenceBoostPower);
score += FindVertexScore_ValenceBoostScale * valence_boost;
- }
return score;
}
diff --git a/indra/llmath/tests/llquaternion_test.cpp b/indra/llmath/tests/llquaternion_test.cpp
index e69010b2d6..3490829743 100755
--- a/indra/llmath/tests/llquaternion_test.cpp
+++ b/indra/llmath/tests/llquaternion_test.cpp
@@ -175,10 +175,10 @@ namespace tut
void llquat_test_object_t::test<6>()
{
LLQuaternion quat1(3.0f, 2.0f, 6.0f, 0.0f), quat2(1.0f, 1.0f, 1.0f, 1.0f);
- ensure("1. The two values are different", llround(12.000000f, 2) == llround(dot(quat1, quat2), 2));
+ ensure("1. The two values are different", ll_round(12.000000f, 2) == ll_round(dot(quat1, quat2), 2));
LLQuaternion quat0(3.0f, 9.334f, 34.5f, 23.0f), quat(34.5f, 23.23f, 2.0f, 45.5f);
- ensure("2. The two values are different", llround(1435.828807f, 2) == llround(dot(quat0, quat), 2));
+ ensure("2. The two values are different", ll_round(1435.828807f, 2) == ll_round(dot(quat0, quat), 2));
}
//test case for LLQuaternion &LLQuaternion::constrain(F32 radians) fn.
diff --git a/indra/llmath/tests/mathmisc_test.cpp b/indra/llmath/tests/mathmisc_test.cpp
index 91a2e6c009..f12140cf8f 100755
--- a/indra/llmath/tests/mathmisc_test.cpp
+++ b/indra/llmath/tests/mathmisc_test.cpp
@@ -128,33 +128,33 @@ namespace tut
void math_object::test<8>()
{
F32 val = 430903.2f;
- S32 val1 = llround(val);
- ensure("float llround value 1", (430903 == val1));
+ S32 val1 = ll_round(val);
+ ensure("float ll_round value 1", (430903 == val1));
val = -430903.9f;
- val1 = llround(val);
- ensure("float llround value 2", (-430904 == val1));
+ val1 = ll_round(val);
+ ensure("float ll_round value 2", (-430904 == val1));
}
template<> template<>
void math_object::test<9>()
{
F32 val = 430905.2654f, nearest = 100.f;
- val = llround(val, nearest);
- ensure("float llround value 1", (430900 == val));
+ val = ll_round(val, nearest);
+ ensure("float ll_round value 1", (430900 == val));
val = -430905.2654f, nearest = 10.f;
- val = llround(val, nearest);
- ensure("float llround value 1", (-430910 == val));
+ val = ll_round(val, nearest);
+ ensure("float ll_round value 1", (-430910 == val));
}
template<> template<>
void math_object::test<10>()
{
F64 val = 430905.2654, nearest = 100.0;
- val = llround(val, nearest);
- ensure("double llround value 1", (430900 == val));
+ val = ll_round(val, nearest);
+ ensure("double ll_round value 1", (430900 == val));
val = -430905.2654, nearest = 10.0;
- val = llround(val, nearest);
- ensure("double llround value 1", (-430910.00000 == val));
+ val = ll_round(val, nearest);
+ ensure("double ll_round value 1", (-430910.00000 == val));
}
template<> template<>
diff --git a/indra/llmath/tests/v4coloru_test.cpp b/indra/llmath/tests/v4coloru_test.cpp
index 128f6f3564..12e607a820 100755
--- a/indra/llmath/tests/v4coloru_test.cpp
+++ b/indra/llmath/tests/v4coloru_test.cpp
@@ -300,8 +300,8 @@ namespace tut
LLColor4U llcolor4u(r,g,b,a),llcolor4u1;
const F32 fVal = 3.f;
llcolor4u1 = llcolor4u.multAll(fVal);
- ensure("multAll:Fail to multiply ", (((U8)llround(r * fVal) == llcolor4u1.mV[VX]) && (U8)llround(g * fVal) == llcolor4u1.mV[VY]
- && ((U8)llround(b * fVal) == llcolor4u1.mV[VZ])&& ((U8)llround(a * fVal) == llcolor4u1.mV[VW])));
+ ensure("multAll:Fail to multiply ", (((U8)ll_round(r * fVal) == llcolor4u1.mV[VX]) && (U8)ll_round(g * fVal) == llcolor4u1.mV[VY]
+ && ((U8)ll_round(b * fVal) == llcolor4u1.mV[VZ])&& ((U8)ll_round(a * fVal) == llcolor4u1.mV[VW])));
}
template<> template<>
@@ -329,8 +329,8 @@ namespace tut
llcolor4u.setVecScaleClamp(color3);
const S32 MAX_COLOR = 255;
F32 color_scale_factor = MAX_COLOR/r;
- S32 r2 = llround(r * color_scale_factor);
- S32 g2 = llround(g * color_scale_factor);
+ S32 r2 = ll_round(r * color_scale_factor);
+ S32 g2 = ll_round(g * color_scale_factor);
ensure("setVecScaleClamp():Fail to add the value ", ((r2 == llcolor4u.mV[VX]) && (g2 == llcolor4u.mV[VY]) && (0 == llcolor4u.mV[VZ])&& (255 == llcolor4u.mV[VW])));
}
}
diff --git a/indra/llmath/v4color.cpp b/indra/llmath/v4color.cpp
index cd2be7c8fd..79a64b24f2 100755
--- a/indra/llmath/v4color.cpp
+++ b/indra/llmath/v4color.cpp
@@ -125,10 +125,10 @@ LLColor4 LLColor4::cyan6(0.2f, 0.6f, 0.6f, 1.0f);
LLColor4::operator const LLColor4U() const
{
return LLColor4U(
- (U8)llclampb(llround(mV[VRED]*255.f)),
- (U8)llclampb(llround(mV[VGREEN]*255.f)),
- (U8)llclampb(llround(mV[VBLUE]*255.f)),
- (U8)llclampb(llround(mV[VALPHA]*255.f)));
+ (U8)llclampb(ll_round(mV[VRED]*255.f)),
+ (U8)llclampb(ll_round(mV[VGREEN]*255.f)),
+ (U8)llclampb(ll_round(mV[VBLUE]*255.f)),
+ (U8)llclampb(ll_round(mV[VALPHA]*255.f)));
}
LLColor4::LLColor4(const LLColor3 &vec, F32 a)
diff --git a/indra/llmath/v4coloru.h b/indra/llmath/v4coloru.h
index 12da7e2dd7..fddad34978 100755
--- a/indra/llmath/v4coloru.h
+++ b/indra/llmath/v4coloru.h
@@ -353,10 +353,10 @@ inline LLColor4U LLColor4U::multAll(const F32 k)
{
// Round to nearest
return LLColor4U(
- (U8)llround(mV[VX] * k),
- (U8)llround(mV[VY] * k),
- (U8)llround(mV[VZ] * k),
- (U8)llround(mV[VW] * k));
+ (U8)ll_round(mV[VX] * k),
+ (U8)ll_round(mV[VY] * k),
+ (U8)ll_round(mV[VZ] * k),
+ (U8)ll_round(mV[VW] * k));
}
/*
inline LLColor4U operator*(const LLColor4U &a, U8 k)
@@ -471,7 +471,7 @@ void LLColor4U::setVecScaleClamp(const LLColor4& color)
color_scale_factor /= max_color;
}
const S32 MAX_COLOR = 255;
- S32 r = llround(color.mV[0] * color_scale_factor);
+ S32 r = ll_round(color.mV[0] * color_scale_factor);
if (r > MAX_COLOR)
{
r = MAX_COLOR;
@@ -482,7 +482,7 @@ void LLColor4U::setVecScaleClamp(const LLColor4& color)
}
mV[0] = r;
- S32 g = llround(color.mV[1] * color_scale_factor);
+ S32 g = ll_round(color.mV[1] * color_scale_factor);
if (g > MAX_COLOR)
{
g = MAX_COLOR;
@@ -493,7 +493,7 @@ void LLColor4U::setVecScaleClamp(const LLColor4& color)
}
mV[1] = g;
- S32 b = llround(color.mV[2] * color_scale_factor);
+ S32 b = ll_round(color.mV[2] * color_scale_factor);
if (b > MAX_COLOR)
{
b = MAX_COLOR;
@@ -505,7 +505,7 @@ void LLColor4U::setVecScaleClamp(const LLColor4& color)
mV[2] = b;
// Alpha shouldn't be scaled, just clamped...
- S32 a = llround(color.mV[3] * MAX_COLOR);
+ S32 a = ll_round(color.mV[3] * MAX_COLOR);
if (a > MAX_COLOR)
{
a = MAX_COLOR;
@@ -527,7 +527,7 @@ void LLColor4U::setVecScaleClamp(const LLColor3& color)
}
const S32 MAX_COLOR = 255;
- S32 r = llround(color.mV[0] * color_scale_factor);
+ S32 r = ll_round(color.mV[0] * color_scale_factor);
if (r > MAX_COLOR)
{
r = MAX_COLOR;
@@ -539,7 +539,7 @@ void LLColor4U::setVecScaleClamp(const LLColor3& color)
}
mV[0] = r;
- S32 g = llround(color.mV[1] * color_scale_factor);
+ S32 g = ll_round(color.mV[1] * color_scale_factor);
if (g > MAX_COLOR)
{
g = MAX_COLOR;
@@ -551,7 +551,7 @@ void LLColor4U::setVecScaleClamp(const LLColor3& color)
}
mV[1] = g;
- S32 b = llround(color.mV[2] * color_scale_factor);
+ S32 b = ll_round(color.mV[2] * color_scale_factor);
if (b > MAX_COLOR)
{
b = MAX_COLOR;
diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp
index 4dd8d04656..daf3e0b4de 100755
--- a/indra/llmessage/llcachename.cpp
+++ b/indra/llmessage/llcachename.cpp
@@ -51,9 +51,6 @@ static const std::string NAME("name");
// We won't re-request a name during this time
const U32 PENDING_TIMEOUT_SECS = 5 * 60;
-// File version number
-const S32 CN_FILE_VERSION = 2;
-
// Globals
LLCacheName* gCacheName = NULL;
std::map<std::string, std::string> LLCacheName::sCacheName;
diff --git a/indra/llmessage/llcircuit.cpp b/indra/llmessage/llcircuit.cpp
index 5aaada63b1..3eb0e0d057 100755
--- a/indra/llmessage/llcircuit.cpp
+++ b/indra/llmessage/llcircuit.cpp
@@ -688,7 +688,7 @@ void LLCircuitData::checkPacketInID(TPACKETID id, BOOL receive_resent)
// now, check to see if we've got a gap
U32 gap = 0;
- if ((mPacketsInID == id))
+ if (mPacketsInID == id)
{
// nope! bump and wrap the counter, then return
mPacketsInID++;
diff --git a/indra/llmessage/llhttpassetstorage.cpp b/indra/llmessage/llhttpassetstorage.cpp
index a30140e8f3..e202154445 100755
--- a/indra/llmessage/llhttpassetstorage.cpp
+++ b/indra/llmessage/llhttpassetstorage.cpp
@@ -47,8 +47,7 @@
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;
+
// Try for 30 minutes for now.
const F32 GET_URL_TO_FILE_TIMEOUT = 1800.0f;
diff --git a/indra/llmessage/lliopipe.h b/indra/llmessage/lliopipe.h
index 9a0a427efd..7fd4cee8ba 100755
--- a/indra/llmessage/lliopipe.h
+++ b/indra/llmessage/lliopipe.h
@@ -56,11 +56,8 @@ void pump_debug(const char *file, S32 line);
/**
* intrusive pointer support
*/
-namespace boost
-{
- void intrusive_ptr_add_ref(LLIOPipe* p);
- void intrusive_ptr_release(LLIOPipe* p);
-};
+void intrusive_ptr_add_ref(LLIOPipe* p);
+void intrusive_ptr_release(LLIOPipe* p);
/**
* @class LLIOPipe
@@ -251,68 +248,21 @@ protected:
LLPumpIO* pump) = 0;
private:
- friend void boost::intrusive_ptr_add_ref(LLIOPipe* p);
- friend void boost::intrusive_ptr_release(LLIOPipe* p);
+ friend void intrusive_ptr_add_ref(LLIOPipe* p);
+ friend void intrusive_ptr_release(LLIOPipe* p);
U32 mReferenceCount;
};
-namespace boost
+inline void intrusive_ptr_add_ref(LLIOPipe* p)
{
- inline void intrusive_ptr_add_ref(LLIOPipe* p)
- {
- ++p->mReferenceCount;
- }
- inline void intrusive_ptr_release(LLIOPipe* p)
+ ++p->mReferenceCount;
+}
+inline void intrusive_ptr_release(LLIOPipe* p)
+{
+ if(p && 0 == --p->mReferenceCount)
{
- if(p && 0 == --p->mReferenceCount)
- {
- delete p;
- }
+ delete p;
}
-};
-
-
-#if 0
-/**
- * @class LLIOBoiler
- * @brief This class helps construct new LLIOPipe specializations
- * @see LLIOPipe
- *
- * THOROUGH_DESCRIPTION
- */
-class LLIOBoiler : public LLIOPipe
-{
-public:
- LLIOBoiler();
- virtual ~LLIOBoiler();
-
-protected:
- /* @name LLIOPipe virtual implementations
- */
- //@{
- /**
- * @brief Process the data in buffer
- */
- virtual EStatus process_impl(
- const LLChannelDescriptors& channels,
- buffer_ptr_t& buffer,
- bool& eos,
- LLSD& context,
- LLPumpIO* pump);
- //@}
-};
-
-// virtual
-LLIOPipe::EStatus process_impl(
- const LLChannelDescriptors& channels,
- buffer_ptr_t& buffer,
- bool& eos,
- LLSD& context,
- LLPumpIO* pump)
-{
- return STATUS_NOT_IMPLEMENTED;
}
-#endif // #if 0 - use this block as a boilerplate
-
#endif // LL_LLIOPIPE_H
diff --git a/indra/llmessage/llpartdata.cpp b/indra/llmessage/llpartdata.cpp
index 41a0310ce0..53aa35c0f9 100755
--- a/indra/llmessage/llpartdata.cpp
+++ b/indra/llmessage/llpartdata.cpp
@@ -49,11 +49,6 @@ const S32 PS_MAX_DATA_BLOCK_SIZE = PS_SYS_DATA_BLOCK_SIZE+
const S32 PS_LEGACY_DATA_BLOCK_SIZE = PS_SYS_DATA_BLOCK_SIZE + PS_LEGACY_PART_DATA_BLOCK_SIZE;
-
-const U32 PART_DATA_MASK = LLPartData::LL_PART_DATA_GLOW | LLPartData::LL_PART_DATA_BLEND;
-
-
-
const F32 MAX_PART_SCALE = 4.f;
bool LLPartData::hasGlow() const
diff --git a/indra/llmessage/llregionhandle.h b/indra/llmessage/llregionhandle.h
index e3ddd46acd..085757dcbc 100755
--- a/indra/llmessage/llregionhandle.h
+++ b/indra/llmessage/llregionhandle.h
@@ -73,7 +73,7 @@ inline BOOL to_region_handle(const F32 x_pos, const F32 y_pos, U64 *region_handl
}
else
{
- x_int = (U32)llround(x_pos);
+ x_int = (U32)ll_round(x_pos);
}
if (y_pos < 0.f)
{
@@ -82,7 +82,7 @@ inline BOOL to_region_handle(const F32 x_pos, const F32 y_pos, U64 *region_handl
}
else
{
- y_int = (U32)llround(y_pos);
+ y_int = (U32)ll_round(y_pos);
}
*region_handle = to_region_handle(x_int, y_int);
return TRUE;
diff --git a/indra/llmessage/llthrottle.cpp b/indra/llmessage/llthrottle.cpp
index e484bd258d..7605da4d3f 100755
--- a/indra/llmessage/llthrottle.cpp
+++ b/indra/llmessage/llthrottle.cpp
@@ -391,7 +391,7 @@ BOOL LLThrottleGroup::dynamicAdjust()
}
mBitsSentThisPeriod[i] = 0;
- total += llround(mBitsSentHistory[i]);
+ total += ll_round(mBitsSentHistory[i]);
}
// Look for busy channels
diff --git a/indra/llmessage/llxfermanager.cpp b/indra/llmessage/llxfermanager.cpp
index b518dd1b72..0ab67b8dda 100755
--- a/indra/llmessage/llxfermanager.cpp
+++ b/indra/llmessage/llxfermanager.cpp
@@ -261,7 +261,7 @@ U32 LLXferManager::numActiveListEntries(LLXfer *list_head)
while (list_head)
{
- if ((list_head->mStatus == e_LL_XFER_IN_PROGRESS))
+ if (list_head->mStatus == e_LL_XFER_IN_PROGRESS)
{
num_entries++;
}
diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp
index cc2d5d66ad..0c3c14969b 100755
--- a/indra/llmessage/message.cpp
+++ b/indra/llmessage/message.cpp
@@ -2752,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.value()) << "%" << LL_ENDL;
+ << " Invalid: " << std::setw(3) << mt->mReceiveInvalid << " " << mt->mName << " " << ll_round(100 * mt->mDecodeTimeThisFrame / mReceiveTime.value()) << "%" << LL_ENDL;
}
}
}
diff --git a/indra/llmessage/tests/llhost_test.cpp b/indra/llmessage/tests/llhost_test.cpp
index eadf83c428..efca1bbfca 100755
--- a/indra/llmessage/tests/llhost_test.cpp
+++ b/indra/llmessage/tests/llhost_test.cpp
@@ -151,11 +151,31 @@ namespace tut
template<> template<>
void host_object::test<9>()
{
- skip("this test is flaky, but we should figure out why...");
+ skip("this test is irreparably flaky");
// skip("setHostByName(\"google.com\"); getHostName() -> (e.g.) \"yx-in-f100.1e100.net\"");
- std::string hostStr = "lindenlab.com";
+ // nat: is it reasonable to expect LLHost::getHostName() to echo
+ // back something resembling the string passed to setHostByName()?
+ //
+ // If that's not even reasonable, would a round trip in the /other/
+ // direction make more sense? (Call getHostName() for something with
+ // known IP address; call setHostByName(); verify IP address)
+ //
+ // Failing that... is there a plausible way to test getHostName() and
+ // setHostByName()? Hopefully without putting up a dummy local DNS
+ // server?
+
+ // monty: If you don't control the DNS server or the DNS configuration
+ // for the test point then, no, none of these will necessarily be
+ // reliable and may start to fail at any time. Forward translation
+ // is subject to CNAME records and round-robin address assignment.
+ // Reverse lookup is 1-to-many and is more and more likely to have
+ // nothing to do with the forward translation.
+ //
+ // So the test is increasingly meaningless on a real network.
+
+ std::string hostStr = "lindenlab.com";
LLHost host;
- host.setHostByName(hostStr);
+ host.setHostByName(hostStr);
// reverse DNS will likely result in appending of some
// sub-domain to the main hostname. so look for
@@ -177,9 +197,9 @@ namespace tut
template<> template<>
void host_object::test<10>()
{
- std::string hostStr = "64.233.167.99";
+ std::string hostStr = "64.233.167.99";
LLHost host;
- host.setHostByName(hostStr);
+ host.setHostByName(hostStr);
ensure("SetHostByName for dotted IP Address failed", host.getAddress() == ip_string_to_u32(hostStr.c_str()));
}
diff --git a/indra/llplugin/CMakeLists.txt b/indra/llplugin/CMakeLists.txt
index 75d89aac78..05fc12e338 100755
--- a/indra/llplugin/CMakeLists.txt
+++ b/indra/llplugin/CMakeLists.txt
@@ -68,7 +68,7 @@ list(APPEND llplugin_SOURCE_FILES ${llplugin_HEADER_FILES})
add_library (llplugin ${llplugin_SOURCE_FILES})
-add_subdirectory(slplugin)
+##add_subdirectory(slplugin)
# Add tests
if (LL_TESTS)
diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp
index 0644d2638c..52626b0302 100755
--- a/indra/llplugin/llpluginclassmedia.cpp
+++ b/indra/llplugin/llpluginclassmedia.cpp
@@ -32,8 +32,6 @@
#include "llpluginclassmedia.h"
#include "llpluginmessageclasses.h"
-#include "llqtwebkit.h"
-
static int LOW_PRIORITY_TEXTURE_SIZE_DEFAULT = 256;
static int nextPowerOf2( int value )
diff --git a/indra/llplugin/slplugin/slplugin-objc.h b/indra/llplugin/slplugin/slplugin-objc.h
index f2c2b3239c..af0ebe1af2 100755
--- a/indra/llplugin/slplugin/slplugin-objc.h
+++ b/indra/llplugin/slplugin/slplugin-objc.h
@@ -29,7 +29,9 @@
*/
//Protos for ObjectiveC classes (cannot import cocoa here due to BOOL conflict)
+#ifndef __OBJC__
class NSWindow;
+#endif // __OBJC__
/* Defined in slplugin-objc.mm: */
diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp
index 7f3c8da434..57ceb3e11b 100644
--- a/indra/llprimitive/llmaterial.cpp
+++ b/indra/llprimitive/llmaterial.cpp
@@ -119,18 +119,18 @@ LLSD LLMaterial::asLLSD() const
LLSD material_data;
material_data[MATERIALS_CAP_NORMAL_MAP_FIELD] = mNormalID;
- material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_X_FIELD] = llround(mNormalOffsetX * MATERIALS_MULTIPLIER);
- material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD] = llround(mNormalOffsetY * MATERIALS_MULTIPLIER);
- material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_X_FIELD] = llround(mNormalRepeatX * MATERIALS_MULTIPLIER);
- material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_Y_FIELD] = llround(mNormalRepeatY * MATERIALS_MULTIPLIER);
- material_data[MATERIALS_CAP_NORMAL_MAP_ROTATION_FIELD] = llround(mNormalRotation * MATERIALS_MULTIPLIER);
+ material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_X_FIELD] = ll_round(mNormalOffsetX * MATERIALS_MULTIPLIER);
+ material_data[MATERIALS_CAP_NORMAL_MAP_OFFSET_Y_FIELD] = ll_round(mNormalOffsetY * MATERIALS_MULTIPLIER);
+ material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_X_FIELD] = ll_round(mNormalRepeatX * MATERIALS_MULTIPLIER);
+ material_data[MATERIALS_CAP_NORMAL_MAP_REPEAT_Y_FIELD] = ll_round(mNormalRepeatY * MATERIALS_MULTIPLIER);
+ material_data[MATERIALS_CAP_NORMAL_MAP_ROTATION_FIELD] = ll_round(mNormalRotation * MATERIALS_MULTIPLIER);
material_data[MATERIALS_CAP_SPECULAR_MAP_FIELD] = mSpecularID;
- material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_X_FIELD] = llround(mSpecularOffsetX * MATERIALS_MULTIPLIER);
- material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD] = llround(mSpecularOffsetY * MATERIALS_MULTIPLIER);
- material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_X_FIELD] = llround(mSpecularRepeatX * MATERIALS_MULTIPLIER);
- material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_Y_FIELD] = llround(mSpecularRepeatY * MATERIALS_MULTIPLIER);
- material_data[MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD] = llround(mSpecularRotation * MATERIALS_MULTIPLIER);
+ material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_X_FIELD] = ll_round(mSpecularOffsetX * MATERIALS_MULTIPLIER);
+ material_data[MATERIALS_CAP_SPECULAR_MAP_OFFSET_Y_FIELD] = ll_round(mSpecularOffsetY * MATERIALS_MULTIPLIER);
+ material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_X_FIELD] = ll_round(mSpecularRepeatX * MATERIALS_MULTIPLIER);
+ material_data[MATERIALS_CAP_SPECULAR_MAP_REPEAT_Y_FIELD] = ll_round(mSpecularRepeatY * MATERIALS_MULTIPLIER);
+ material_data[MATERIALS_CAP_SPECULAR_MAP_ROTATION_FIELD] = ll_round(mSpecularRotation * MATERIALS_MULTIPLIER);
material_data[MATERIALS_CAP_SPECULAR_COLOR_FIELD] = mSpecularLightColor.getValue();
material_data[MATERIALS_CAP_SPECULAR_EXP_FIELD] = mSpecularLightExponent;
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index b4963225dc..caabbf997f 100755
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -172,7 +172,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
if (!pos_source)
{
- llwarns << "Unable to process mesh without position data; invalid model; invalid model." << llendl;
+ LL_WARNS() << "Unable to process mesh without position data; invalid model; invalid model." << LL_ENDL;
return LLModel::BAD_ELEMENT;
}
@@ -180,20 +180,20 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
domListOfUInts& idx = p->getValue();
domListOfFloats dummy ;
- domListOfFloats& v = pos_source ? pos_source->getFloat_array()->getValue() : dummy ;
- domListOfFloats& tc = tc_source ? tc_source->getFloat_array()->getValue() : dummy ;
- domListOfFloats& n = norm_source ? norm_source->getFloat_array()->getValue() : dummy ;
+ domListOfFloats& v = (pos_source && pos_source->getFloat_array()) ? pos_source->getFloat_array()->getValue() : dummy ;
+ domListOfFloats& tc = (tc_source && tc_source->getFloat_array()) ? tc_source->getFloat_array()->getValue() : dummy ;
+ domListOfFloats& n = (norm_source && norm_source->getFloat_array()) ? norm_source->getFloat_array()->getValue() : dummy ;
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;
+ U32 vertex_count = (pos_source && pos_source->getFloat_array()) ? v.getCount() : 0;
+ U32 tc_count = (tc_source && tc_source->getFloat_array()) ? tc.getCount() : 0;
+ U32 norm_count = (norm_source && norm_source->getFloat_array()) ? n.getCount(): 0;
- if ((vertex_count == 0) || (tc_count == 0))
+ if (vertex_count == 0)
{
- llwarns << "Unable to process mesh with empty position array; invalid model." << llendl;
+ LL_WARNS() << "Unable to process mesh with empty position array; invalid model." << LL_ENDL;
return LLModel::BAD_ELEMENT;
}
@@ -229,7 +229,7 @@ LLModel::EModelStatus load_face_from_dom_triangles(std::vector<LLVolumeFace>& fa
{
// guard against model data specifiying out of range indices or tcs
//
-
+
if (((i + tc_offset) > index_count)
|| ((idx[i+tc_offset]*2+1) > tc_count))
{
diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp
index a505ea04a7..6e4ccb9ea1 100755
--- a/indra/llprimitive/llprimitive.cpp
+++ b/indra/llprimitive/llprimitive.cpp
@@ -107,8 +107,6 @@ const F32 FLEXIBLE_OBJECT_DEFAULT_LENGTH = 1.0f;
const BOOL FLEXIBLE_OBJECT_DEFAULT_USING_COLLISION_SPHERE = FALSE;
const BOOL FLEXIBLE_OBJECT_DEFAULT_RENDERING_COLLISION_SPHERE = FALSE;
-const S32 MAX_FACE_BITS = 9;
-
const char *SCULPT_DEFAULT_TEXTURE = "be293869-d0d9-0a69-5989-ad27f1946fd4"; // old inverted texture: "7595d345-a24c-e7ef-f0bd-78793792133e";
// Texture rotations are sent over the wire as a S16. This is used to scale the actual float
@@ -993,8 +991,6 @@ BOOL LLPrimitive::setMaterial(U8 material)
}
}
-const F32 LL_MAX_SCALE_S = 100.0f;
-const F32 LL_MAX_SCALE_T = 100.0f;
S32 LLPrimitive::packTEField(U8 *cur_ptr, U8 *data_ptr, U8 data_size, U8 last_face_index, EMsgVariableType type) const
{
S32 face_index;
@@ -1148,12 +1144,12 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys) const
const LLTextureEntry* te = getTE(face_index);
scale_s[face_index] = (F32) te->mScaleS;
scale_t[face_index] = (F32) te->mScaleT;
- offset_s[face_index] = (S16) llround((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ;
- offset_t[face_index] = (S16) llround((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ;
- image_rot[face_index] = (S16) llround(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * TEXTURE_ROTATION_PACK_FACTOR));
+ offset_s[face_index] = (S16) ll_round((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ;
+ offset_t[face_index] = (S16) ll_round((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ;
+ image_rot[face_index] = (S16) ll_round(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * TEXTURE_ROTATION_PACK_FACTOR));
bump[face_index] = te->getBumpShinyFullbright();
media_flags[face_index] = te->getMediaTexGen();
- glow[face_index] = (U8) llround((llclamp(te->getGlow(), 0.0f, 1.0f) * (F32)0xFF));
+ glow[face_index] = (U8) ll_round((llclamp(te->getGlow(), 0.0f, 1.0f) * (F32)0xFF));
// Directly sending material_ids is not safe!
memcpy(&material_data[face_index*16],getTE(face_index)->getMaterialID().get(),16); /* Flawfinder: ignore */
@@ -1233,12 +1229,12 @@ BOOL LLPrimitive::packTEMessage(LLDataPacker &dp) const
const LLTextureEntry* te = getTE(face_index);
scale_s[face_index] = (F32) te->mScaleS;
scale_t[face_index] = (F32) te->mScaleT;
- offset_s[face_index] = (S16) llround((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ;
- offset_t[face_index] = (S16) llround((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ;
- image_rot[face_index] = (S16) llround(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * TEXTURE_ROTATION_PACK_FACTOR));
+ offset_s[face_index] = (S16) ll_round((llclamp(te->mOffsetS,-1.0f,1.0f) * (F32)0x7FFF)) ;
+ offset_t[face_index] = (S16) ll_round((llclamp(te->mOffsetT,-1.0f,1.0f) * (F32)0x7FFF)) ;
+ image_rot[face_index] = (S16) ll_round(((fmod(te->mRotation, F_TWO_PI)/F_TWO_PI) * TEXTURE_ROTATION_PACK_FACTOR));
bump[face_index] = te->getBumpShinyFullbright();
media_flags[face_index] = te->getMediaTexGen();
- glow[face_index] = (U8) llround((llclamp(te->getGlow(), 0.0f, 1.0f) * (F32)0xFF));
+ glow[face_index] = (U8) ll_round((llclamp(te->getGlow(), 0.0f, 1.0f) * (F32)0xFF));
// Directly sending material_ids is not safe!
memcpy(&material_data[face_index*16],getTE(face_index)->getMaterialID().get(),16); /* Flawfinder: ignore */
diff --git a/indra/llprimitive/llvolumemessage.cpp b/indra/llprimitive/llvolumemessage.cpp
index a2c2666146..8d47a7147f 100755
--- a/indra/llprimitive/llvolumemessage.cpp
+++ b/indra/llprimitive/llvolumemessage.cpp
@@ -52,13 +52,13 @@ bool LLVolumeMessage::packProfileParams(
tempU8 = params->getCurveType();
mesgsys->addU8Fast(_PREHASH_ProfileCurve, tempU8);
- tempU16 = (U16) llround( params->getBegin() / CUT_QUANTA);
+ tempU16 = (U16) ll_round( params->getBegin() / CUT_QUANTA);
mesgsys->addU16Fast(_PREHASH_ProfileBegin, tempU16);
- tempU16 = 50000 - (U16) llround(params->getEnd() / CUT_QUANTA);
+ tempU16 = 50000 - (U16) ll_round(params->getEnd() / CUT_QUANTA);
mesgsys->addU16Fast(_PREHASH_ProfileEnd, tempU16);
- tempU16 = (U16) llround(params->getHollow() / HOLLOW_QUANTA);
+ tempU16 = (U16) ll_round(params->getHollow() / HOLLOW_QUANTA);
mesgsys->addU16Fast(_PREHASH_ProfileHollow, tempU16);
return true;
@@ -80,13 +80,13 @@ bool LLVolumeMessage::packProfileParams(
tempU8 = params->getCurveType();
dp.packU8(tempU8, "Curve");
- tempU16 = (U16) llround( params->getBegin() / CUT_QUANTA);
+ tempU16 = (U16) ll_round( params->getBegin() / CUT_QUANTA);
dp.packU16(tempU16, "Begin");
- tempU16 = 50000 - (U16) llround(params->getEnd() / CUT_QUANTA);
+ tempU16 = 50000 - (U16) ll_round(params->getEnd() / CUT_QUANTA);
dp.packU16(tempU16, "End");
- tempU16 = (U16) llround(params->getHollow() / HOLLOW_QUANTA);
+ tempU16 = (U16) ll_round(params->getHollow() / HOLLOW_QUANTA);
dp.packU16(tempU16, "Hollow");
return true;
}
@@ -217,46 +217,46 @@ bool LLVolumeMessage::packPathParams(
U8 curve = params->getCurveType();
mesgsys->addU8Fast(_PREHASH_PathCurve, curve);
- U16 begin = (U16) llround(params->getBegin() / CUT_QUANTA);
+ U16 begin = (U16) ll_round(params->getBegin() / CUT_QUANTA);
mesgsys->addU16Fast(_PREHASH_PathBegin, begin);
- U16 end = 50000 - (U16) llround(params->getEnd() / CUT_QUANTA);
+ U16 end = 50000 - (U16) ll_round(params->getEnd() / CUT_QUANTA);
mesgsys->addU16Fast(_PREHASH_PathEnd, end);
// Avoid truncation problem with direct F32->U8 cast.
// (e.g., (U8) (0.50 / 0.01) = (U8) 49.9999999 = 49 not 50.
- U8 pack_scale_x = 200 - (U8) llround(params->getScaleX() / SCALE_QUANTA);
+ U8 pack_scale_x = 200 - (U8) ll_round(params->getScaleX() / SCALE_QUANTA);
mesgsys->addU8Fast(_PREHASH_PathScaleX, pack_scale_x );
- U8 pack_scale_y = 200 - (U8) llround(params->getScaleY() / SCALE_QUANTA);
+ U8 pack_scale_y = 200 - (U8) ll_round(params->getScaleY() / SCALE_QUANTA);
mesgsys->addU8Fast(_PREHASH_PathScaleY, pack_scale_y );
- U8 pack_shear_x = (U8) llround(params->getShearX() / SHEAR_QUANTA);
+ U8 pack_shear_x = (U8) ll_round(params->getShearX() / SHEAR_QUANTA);
mesgsys->addU8Fast(_PREHASH_PathShearX, pack_shear_x );
- U8 pack_shear_y = (U8) llround(params->getShearY() / SHEAR_QUANTA);
+ U8 pack_shear_y = (U8) ll_round(params->getShearY() / SHEAR_QUANTA);
mesgsys->addU8Fast(_PREHASH_PathShearY, pack_shear_y );
- S8 twist = (S8) llround(params->getTwist() / SCALE_QUANTA);
+ S8 twist = (S8) ll_round(params->getTwist() / SCALE_QUANTA);
mesgsys->addS8Fast(_PREHASH_PathTwist, twist);
- S8 twist_begin = (S8) llround(params->getTwistBegin() / SCALE_QUANTA);
+ S8 twist_begin = (S8) ll_round(params->getTwistBegin() / SCALE_QUANTA);
mesgsys->addS8Fast(_PREHASH_PathTwistBegin, twist_begin);
- S8 radius_offset = (S8) llround(params->getRadiusOffset() / SCALE_QUANTA);
+ S8 radius_offset = (S8) ll_round(params->getRadiusOffset() / SCALE_QUANTA);
mesgsys->addS8Fast(_PREHASH_PathRadiusOffset, radius_offset);
- S8 taper_x = (S8) llround(params->getTaperX() / TAPER_QUANTA);
+ S8 taper_x = (S8) ll_round(params->getTaperX() / TAPER_QUANTA);
mesgsys->addS8Fast(_PREHASH_PathTaperX, taper_x);
- S8 taper_y = (S8) llround(params->getTaperY() / TAPER_QUANTA);
+ S8 taper_y = (S8) ll_round(params->getTaperY() / TAPER_QUANTA);
mesgsys->addS8Fast(_PREHASH_PathTaperY, taper_y);
- U8 revolutions = (U8) llround( (params->getRevolutions() - 1.0f) / REV_QUANTA);
+ U8 revolutions = (U8) ll_round( (params->getRevolutions() - 1.0f) / REV_QUANTA);
mesgsys->addU8Fast(_PREHASH_PathRevolutions, revolutions);
- S8 skew = (S8) llround(params->getSkew() / SCALE_QUANTA);
+ S8 skew = (S8) ll_round(params->getSkew() / SCALE_QUANTA);
mesgsys->addS8Fast(_PREHASH_PathSkew, skew);
return true;
@@ -274,46 +274,46 @@ bool LLVolumeMessage::packPathParams(
U8 curve = params->getCurveType();
dp.packU8(curve, "Curve");
- U16 begin = (U16) llround(params->getBegin() / CUT_QUANTA);
+ U16 begin = (U16) ll_round(params->getBegin() / CUT_QUANTA);
dp.packU16(begin, "Begin");
- U16 end = 50000 - (U16) llround(params->getEnd() / CUT_QUANTA);
+ U16 end = 50000 - (U16) ll_round(params->getEnd() / CUT_QUANTA);
dp.packU16(end, "End");
// Avoid truncation problem with direct F32->U8 cast.
// (e.g., (U8) (0.50 / 0.01) = (U8) 49.9999999 = 49 not 50.
- U8 pack_scale_x = 200 - (U8) llround(params->getScaleX() / SCALE_QUANTA);
+ U8 pack_scale_x = 200 - (U8) ll_round(params->getScaleX() / SCALE_QUANTA);
dp.packU8(pack_scale_x, "ScaleX");
- U8 pack_scale_y = 200 - (U8) llround(params->getScaleY() / SCALE_QUANTA);
+ U8 pack_scale_y = 200 - (U8) ll_round(params->getScaleY() / SCALE_QUANTA);
dp.packU8(pack_scale_y, "ScaleY");
- S8 pack_shear_x = (S8) llround(params->getShearX() / SHEAR_QUANTA);
+ S8 pack_shear_x = (S8) ll_round(params->getShearX() / SHEAR_QUANTA);
dp.packU8(*(U8 *)&pack_shear_x, "ShearX");
- S8 pack_shear_y = (S8) llround(params->getShearY() / SHEAR_QUANTA);
+ S8 pack_shear_y = (S8) ll_round(params->getShearY() / SHEAR_QUANTA);
dp.packU8(*(U8 *)&pack_shear_y, "ShearY");
- S8 twist = (S8) llround(params->getTwist() / SCALE_QUANTA);
+ S8 twist = (S8) ll_round(params->getTwist() / SCALE_QUANTA);
dp.packU8(*(U8 *)&twist, "Twist");
- S8 twist_begin = (S8) llround(params->getTwistBegin() / SCALE_QUANTA);
+ S8 twist_begin = (S8) ll_round(params->getTwistBegin() / SCALE_QUANTA);
dp.packU8(*(U8 *)&twist_begin, "TwistBegin");
- S8 radius_offset = (S8) llround(params->getRadiusOffset() / SCALE_QUANTA);
+ S8 radius_offset = (S8) ll_round(params->getRadiusOffset() / SCALE_QUANTA);
dp.packU8(*(U8 *)&radius_offset, "RadiusOffset");
- S8 taper_x = (S8) llround(params->getTaperX() / TAPER_QUANTA);
+ S8 taper_x = (S8) ll_round(params->getTaperX() / TAPER_QUANTA);
dp.packU8(*(U8 *)&taper_x, "TaperX");
- S8 taper_y = (S8) llround(params->getTaperY() / TAPER_QUANTA);
+ S8 taper_y = (S8) ll_round(params->getTaperY() / TAPER_QUANTA);
dp.packU8(*(U8 *)&taper_y, "TaperY");
- U8 revolutions = (U8) llround( (params->getRevolutions() - 1.0f) / REV_QUANTA);
+ U8 revolutions = (U8) ll_round( (params->getRevolutions() - 1.0f) / REV_QUANTA);
dp.packU8(*(U8 *)&revolutions, "Revolutions");
- S8 skew = (S8) llround(params->getSkew() / SCALE_QUANTA);
+ S8 skew = (S8) ll_round(params->getSkew() / SCALE_QUANTA);
dp.packU8(*(U8 *)&skew, "Skew");
return true;
diff --git a/indra/llrender/CMakeLists.txt b/indra/llrender/CMakeLists.txt
index dba12d048e..331f988382 100755
--- a/indra/llrender/CMakeLists.txt
+++ b/indra/llrender/CMakeLists.txt
@@ -121,7 +121,6 @@ target_link_libraries(llrender
${LLCOMMON_LIBRARIES}
${LLIMAGE_LIBRARIES}
${LLMATH_LIBRARIES}
- ${LLRENDER_LIBRARIES}
${LLVFS_LIBRARIES}
${LLXML_LIBRARIES}
${LLVFS_LIBRARIES}
diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp
index 25b1c533c1..de26d19efc 100755
--- a/indra/llrender/llfontfreetype.cpp
+++ b/indra/llrender/llfontfreetype.cpp
@@ -103,7 +103,6 @@ LLFontGlyphInfo::LLFontGlyphInfo(U32 index)
LLFontFreetype::LLFontFreetype()
: LLTrace::MemTrackable<LLFontFreetype>("LLFontFreetype"),
mFontBitmapCachep(new LLFontBitmapCache),
- mValid(FALSE),
mAscender(0.f),
mDescender(0.f),
mLineHeight(0.f),
@@ -184,8 +183,8 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v
mDescender = -mFTFace->descender * pixels_per_unit;
mLineHeight = mFTFace->height * pixels_per_unit;
- S32 max_char_width = llround(0.5f + (x_max - x_min));
- S32 max_char_height = llround(0.5f + (y_max - y_min));
+ S32 max_char_width = ll_round(0.5f + (x_max - x_min));
+ S32 max_char_height = ll_round(0.5f + (y_max - y_min));
mFontBitmapCachep->init(components, max_char_width, max_char_height);
claimMem(mFontBitmapCachep);
diff --git a/indra/llrender/llfontfreetype.h b/indra/llrender/llfontfreetype.h
index 2963fbd43d..a5ece42b88 100755
--- a/indra/llrender/llfontfreetype.h
+++ b/indra/llrender/llfontfreetype.h
@@ -162,8 +162,6 @@ private:
BOOL mIsFallback;
font_vector_t mFallbackFonts; // A list of fallback fonts to look for glyphs in (for Unicode chars)
- BOOL mValid;
-
typedef boost::unordered_map<llwchar, LLFontGlyphInfo*> char_glyph_info_map_t;
mutable char_glyph_info_map_t mCharGlyphInfoMap; // Information about glyph location in bitmap
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp
index 1d181b476a..53ca080d66 100755
--- a/indra/llrender/llfontgl.cpp
+++ b/indra/llrender/llfontgl.cpp
@@ -61,12 +61,6 @@ LLCoordGL LLFontGL::sCurOrigin;
F32 LLFontGL::sCurDepth;
std::vector<std::pair<LLCoordGL, F32> > LLFontGL::sOriginStack;
-const F32 EXT_X_BEARING = 1.f;
-const F32 EXT_Y_BEARING = 0.f;
-const F32 EXT_KERNING = 1.f;
-const F32 PIXEL_BORDER_THRESHOLD = 0.0001f;
-const F32 PIXEL_CORRECTION_DISTANCE = 0.01f;
-
const F32 PAD_UVY = 0.5f; // half of vertical padding between glyphs in the glyph texture
const F32 DROP_SHADOW_SOFT_STRENGTH = 0.3f;
@@ -217,10 +211,10 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
case LEFT:
break;
case RIGHT:
- cur_x -= llmin(scaled_max_pixels, llround(getWidthF32(wstr.c_str(), begin_offset, length) * sScaleX));
+ cur_x -= llmin(scaled_max_pixels, ll_round(getWidthF32(wstr.c_str(), begin_offset, length) * sScaleX));
break;
case HCENTER:
- cur_x -= llmin(scaled_max_pixels, llround(getWidthF32(wstr.c_str(), begin_offset, length) * sScaleX)) / 2;
+ cur_x -= llmin(scaled_max_pixels, ll_round(getWidthF32(wstr.c_str(), begin_offset, length) * sScaleX)) / 2;
break;
default:
break;
@@ -229,7 +223,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
cur_render_y = cur_y;
cur_render_x = cur_x;
- F32 start_x = (F32)llround(cur_x);
+ F32 start_x = (F32)ll_round(cur_x);
const LLFontBitmapCache* font_bitmap_cache = mFontFreetype->getFontBitmapCache();
@@ -243,12 +237,12 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
if (use_ellipses)
{
// check for too long of a string
- S32 string_width = llround(getWidthF32(wstr.c_str(), begin_offset, max_chars) * sScaleX);
+ S32 string_width = ll_round(getWidthF32(wstr.c_str(), begin_offset, max_chars) * sScaleX);
if (string_width > scaled_max_pixels)
{
// use four dots for ellipsis width to generate padding
const LLWString dots(utf8str_to_wstring(std::string("....")));
- scaled_max_pixels = llmax(0, scaled_max_pixels - llround(getWidthF32(dots.c_str())));
+ scaled_max_pixels = llmax(0, scaled_max_pixels - ll_round(getWidthF32(dots.c_str())));
draw_ellipses = TRUE;
}
}
@@ -313,10 +307,10 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
(fgi->mXBitmapOffset + fgi->mWidth) * inv_width,
(fgi->mYBitmapOffset - PAD_UVY) * inv_height);
// snap glyph origin to whole screen pixel
- LLRectf screen_rect((F32)llround(cur_render_x + (F32)fgi->mXBearing),
- (F32)llround(cur_render_y + (F32)fgi->mYBearing),
- (F32)llround(cur_render_x + (F32)fgi->mXBearing) + (F32)fgi->mWidth,
- (F32)llround(cur_render_y + (F32)fgi->mYBearing) - (F32)fgi->mHeight);
+ LLRectf screen_rect((F32)ll_round(cur_render_x + (F32)fgi->mXBearing),
+ (F32)ll_round(cur_render_y + (F32)fgi->mYBearing),
+ (F32)ll_round(cur_render_x + (F32)fgi->mXBearing) + (F32)fgi->mWidth,
+ (F32)ll_round(cur_render_y + (F32)fgi->mYBearing) - (F32)fgi->mHeight);
if (glyph_count >= GLYPH_BATCH_SIZE)
{
@@ -347,8 +341,8 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
// Must do this to cur_x, not just to cur_render_x, otherwise you
// will squish sub-pixel kerned characters too close together.
// For example, "CCCCC" looks bad.
- cur_x = (F32)llround(cur_x);
- //cur_y = (F32)llround(cur_y);
+ cur_x = (F32)ll_round(cur_x);
+ //cur_y = (F32)ll_round(cur_y);
cur_render_x = cur_x;
cur_render_y = cur_y;
@@ -458,7 +452,7 @@ S32 LLFontGL::getWidth(const std::string& utf8text, S32 begin_offset, S32 max_ch
S32 LLFontGL::getWidth(const llwchar* wchars, S32 begin_offset, S32 max_chars) const
{
F32 width = getWidthF32(wchars, begin_offset, max_chars);
- return llround(width);
+ return ll_round(width);
}
F32 LLFontGL::getWidthF32(const std::string& utf8text) const
@@ -520,7 +514,7 @@ F32 LLFontGL::getWidthF32(const llwchar* wchars, S32 begin_offset, S32 max_chars
cur_x += mFontFreetype->getXKerning(fgi, next_glyph);
}
// Round after kerning.
- cur_x = (F32)llround(cur_x);
+ cur_x = (F32)ll_round(cur_x);
}
// add in extra pixels for last character's width past its xadvance
@@ -628,7 +622,7 @@ S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_ch
}
// Round after kerning.
- cur_x = (F32)llround(cur_x);
+ cur_x = (F32)ll_round(cur_x);
}
if( clip )
@@ -698,7 +692,7 @@ S32 LLFontGL::firstDrawableChar(const llwchar* wchars, F32 max_pixels, S32 text_
}
// Round after kerning.
- total_width = (F32)llround(total_width);
+ total_width = (F32)ll_round(total_width);
}
if (drawable_chars == 0)
@@ -781,7 +775,7 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, S32 begin_offset, F32 t
// Round after kerning.
- cur_x = (F32)llround(cur_x);
+ cur_x = (F32)ll_round(cur_x);
}
return llmin(max_chars, pos - begin_offset);
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index b81dd4c9a1..3ceed95248 100755
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -61,33 +61,33 @@ U64 LLGLSLShader::sTotalSamplesDrawn = 0;
U32 LLGLSLShader::sTotalDrawCalls = 0;
//UI shader -- declared here so llui_libtest will link properly
-LLGLSLShader gUIProgram;
-LLGLSLShader gSolidColorProgram;
+LLGLSLShader gUIProgram;
+LLGLSLShader gSolidColorProgram;
BOOL shouldChange(const LLVector4& v1, const LLVector4& v2)
{
- return v1 != v2;
+ return v1 != v2;
}
LLShaderFeatures::LLShaderFeatures()
- : atmosphericHelpers(false)
- , calculatesLighting(false)
- , calculatesAtmospherics(false)
- , hasLighting(false)
- , isAlphaLighting(false)
- , isShiny(false)
- , isFullbright(false)
- , isSpecular(false)
- , hasWaterFog(false)
- , hasTransport(false)
- , hasSkinning(false)
- , hasObjectSkinning(false)
- , hasAtmospherics(false)
- , hasGamma(false)
- , mIndexedTextureChannels(0)
- , disableTextureIndex(false)
- , hasAlphaMask(false)
- , attachNothing(false)
+ : atmosphericHelpers(false)
+ , calculatesLighting(false)
+ , calculatesAtmospherics(false)
+ , hasLighting(false)
+ , isAlphaLighting(false)
+ , isShiny(false)
+ , isFullbright(false)
+ , isSpecular(false)
+ , hasWaterFog(false)
+ , hasTransport(false)
+ , hasSkinning(false)
+ , hasObjectSkinning(false)
+ , hasAtmospherics(false)
+ , hasGamma(false)
+ , mIndexedTextureChannels(0)
+ , disableTextureIndex(false)
+ , hasAlphaMask(false)
+ , attachNothing(false)
{
}
@@ -98,225 +98,225 @@ LLShaderFeatures::LLShaderFeatures()
//static
void LLGLSLShader::initProfile()
{
- sProfileEnabled = true;
- sTotalTimeElapsed = 0;
- sTotalTrianglesDrawn = 0;
- sTotalSamplesDrawn = 0;
- sTotalDrawCalls = 0;
-
- for (std::set<LLGLSLShader*>::iterator iter = sInstances.begin(); iter != sInstances.end(); ++iter)
- {
- (*iter)->clearStats();
- }
+ sProfileEnabled = true;
+ sTotalTimeElapsed = 0;
+ sTotalTrianglesDrawn = 0;
+ sTotalSamplesDrawn = 0;
+ sTotalDrawCalls = 0;
+
+ for (std::set<LLGLSLShader*>::iterator iter = sInstances.begin(); iter != sInstances.end(); ++iter)
+ {
+ (*iter)->clearStats();
+ }
}
struct LLGLSLShaderCompareTimeElapsed
{
- bool operator()(const LLGLSLShader* const& lhs, const LLGLSLShader* const& rhs)
- {
- return lhs->mTimeElapsed < rhs->mTimeElapsed;
- }
+ bool operator()(const LLGLSLShader* const& lhs, const LLGLSLShader* const& rhs)
+ {
+ return lhs->mTimeElapsed < rhs->mTimeElapsed;
+ }
};
//static
void LLGLSLShader::finishProfile(bool emit_report)
{
- sProfileEnabled = false;
-
- if (emit_report)
- {
- std::vector<LLGLSLShader*> sorted;
-
- for (std::set<LLGLSLShader*>::iterator iter = sInstances.begin(); iter != sInstances.end(); ++iter)
- {
- sorted.push_back(*iter);
- }
-
- std::sort(sorted.begin(), sorted.end(), LLGLSLShaderCompareTimeElapsed());
-
- for (std::vector<LLGLSLShader*>::iterator iter = sorted.begin(); iter != sorted.end(); ++iter)
- {
- (*iter)->dumpStats();
- }
-
- 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;
- }
+ sProfileEnabled = false;
+
+ if (emit_report)
+ {
+ std::vector<LLGLSLShader*> sorted;
+
+ for (std::set<LLGLSLShader*>::iterator iter = sInstances.begin(); iter != sInstances.end(); ++iter)
+ {
+ sorted.push_back(*iter);
+ }
+
+ std::sort(sorted.begin(), sorted.end(), LLGLSLShaderCompareTimeElapsed());
+
+ for (std::vector<LLGLSLShader*>::iterator iter = sorted.begin(); iter != sorted.end(); ++iter)
+ {
+ (*iter)->dumpStats();
+ }
+
+ 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()
{
- mTrianglesDrawn = 0;
- mTimeElapsed = 0;
- mSamplesDrawn = 0;
- mDrawCalls = 0;
- mTextureStateFetched = false;
- mTextureMagFilter.clear();
- mTextureMinFilter.clear();
+ mTrianglesDrawn = 0;
+ mTimeElapsed = 0;
+ mSamplesDrawn = 0;
+ mDrawCalls = 0;
+ mTextureStateFetched = false;
+ mTextureMagFilter.clear();
+ mTextureMinFilter.clear();
}
void LLGLSLShader::dumpStats()
{
- if (mDrawCalls > 0)
- {
- LL_INFOS() << "=============================================" << LL_ENDL;
- LL_INFOS() << mName << LL_ENDL;
- for (U32 i = 0; i < mShaderFiles.size(); ++i)
- {
- LL_INFOS() << mShaderFiles[i].first << LL_ENDL;
- }
- for (U32 i = 0; i < mTexture.size(); ++i)
- {
- GLint idx = mTexture[i];
-
- if (idx >= 0)
- {
- GLint uniform_idx = getUniformLocation(i);
- LL_INFOS() << mUniformNameMap[uniform_idx] << " - " << std::hex << mTextureMagFilter[i] << "/" << mTextureMinFilter[i] << std::dec << LL_ENDL;
- }
- }
- LL_INFOS() << "=============================================" << LL_ENDL;
-
- F32 ms = mTimeElapsed/1000000.f;
- F32 seconds = ms/1000.f;
-
- F32 pct_tris = (F32) mTrianglesDrawn/(F32)sTotalTrianglesDrawn*100.f;
- F32 tris_sec = (F32) (mTrianglesDrawn/1000000.0);
- tris_sec /= seconds;
-
- F32 pct_samples = (F32) ((F64)mSamplesDrawn/(F64)sTotalSamplesDrawn)*100.f;
- F32 samples_sec = (F32) mSamplesDrawn/1000000000.0;
- samples_sec /= seconds;
-
- F32 pct_calls = (F32) mDrawCalls/(F32)sTotalDrawCalls*100.f;
- U32 avg_batch = mTrianglesDrawn/mDrawCalls;
-
- 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;
- }
+ if (mDrawCalls > 0)
+ {
+ LL_INFOS() << "=============================================" << LL_ENDL;
+ LL_INFOS() << mName << LL_ENDL;
+ for (U32 i = 0; i < mShaderFiles.size(); ++i)
+ {
+ LL_INFOS() << mShaderFiles[i].first << LL_ENDL;
+ }
+ for (U32 i = 0; i < mTexture.size(); ++i)
+ {
+ GLint idx = mTexture[i];
+
+ if (idx >= 0)
+ {
+ GLint uniform_idx = getUniformLocation(i);
+ LL_INFOS() << mUniformNameMap[uniform_idx] << " - " << std::hex << mTextureMagFilter[i] << "/" << mTextureMinFilter[i] << std::dec << LL_ENDL;
+ }
+ }
+ LL_INFOS() << "=============================================" << LL_ENDL;
+
+ F32 ms = mTimeElapsed/1000000.f;
+ F32 seconds = ms/1000.f;
+
+ F32 pct_tris = (F32) mTrianglesDrawn/(F32)sTotalTrianglesDrawn*100.f;
+ F32 tris_sec = (F32) (mTrianglesDrawn/1000000.0);
+ tris_sec /= seconds;
+
+ F32 pct_samples = (F32) ((F64)mSamplesDrawn/(F64)sTotalSamplesDrawn)*100.f;
+ F32 samples_sec = (F32) mSamplesDrawn/1000000000.0;
+ samples_sec /= seconds;
+
+ F32 pct_calls = (F32) mDrawCalls/(F32)sTotalDrawCalls*100.f;
+ U32 avg_batch = mTrianglesDrawn/mDrawCalls;
+
+ 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;
+ }
}
//static
void LLGLSLShader::startProfile()
{
- if (sProfileEnabled && sCurBoundShaderPtr)
- {
- sCurBoundShaderPtr->placeProfileQuery();
- }
+ if (sProfileEnabled && sCurBoundShaderPtr)
+ {
+ sCurBoundShaderPtr->placeProfileQuery();
+ }
}
//static
void LLGLSLShader::stopProfile(U32 count, U32 mode)
{
- if (sProfileEnabled)
- {
- sCurBoundShaderPtr->readProfileQuery(count, mode);
- }
+ if (sProfileEnabled && sCurBoundShaderPtr)
+ {
+ sCurBoundShaderPtr->readProfileQuery(count, mode);
+ }
}
void LLGLSLShader::placeProfileQuery()
{
#if !LL_DARWIN
- if (mTimerQuery == 0)
- {
- glGenQueriesARB(1, &mSamplesQuery);
- glGenQueriesARB(1, &mTimerQuery);
- }
+ if (mTimerQuery == 0)
+ {
+ glGenQueriesARB(1, &mSamplesQuery);
+ glGenQueriesARB(1, &mTimerQuery);
+ }
- if (!mTextureStateFetched)
- {
- mTextureStateFetched = true;
- mTextureMagFilter.resize(mTexture.size());
- mTextureMinFilter.resize(mTexture.size());
+ if (!mTextureStateFetched)
+ {
+ mTextureStateFetched = true;
+ mTextureMagFilter.resize(mTexture.size());
+ mTextureMinFilter.resize(mTexture.size());
- U32 cur_active = gGL.getCurrentTexUnitIndex();
+ U32 cur_active = gGL.getCurrentTexUnitIndex();
- for (U32 i = 0; i < mTexture.size(); ++i)
- {
- GLint idx = mTexture[i];
+ for (U32 i = 0; i < mTexture.size(); ++i)
+ {
+ GLint idx = mTexture[i];
- if (idx >= 0)
- {
- gGL.getTexUnit(idx)->activate();
+ if (idx >= 0)
+ {
+ gGL.getTexUnit(idx)->activate();
- U32 mag = 0xFFFFFFFF;
- U32 min = 0xFFFFFFFF;
+ U32 mag = 0xFFFFFFFF;
+ U32 min = 0xFFFFFFFF;
- U32 type = LLTexUnit::getInternalType(gGL.getTexUnit(idx)->getCurrType());
+ U32 type = LLTexUnit::getInternalType(gGL.getTexUnit(idx)->getCurrType());
- glGetTexParameteriv(type, GL_TEXTURE_MAG_FILTER, (GLint*) &mag);
- glGetTexParameteriv(type, GL_TEXTURE_MIN_FILTER, (GLint*) &min);
+ glGetTexParameteriv(type, GL_TEXTURE_MAG_FILTER, (GLint*) &mag);
+ glGetTexParameteriv(type, GL_TEXTURE_MIN_FILTER, (GLint*) &min);
- mTextureMagFilter[i] = mag;
- mTextureMinFilter[i] = min;
- }
- }
+ mTextureMagFilter[i] = mag;
+ mTextureMinFilter[i] = min;
+ }
+ }
- gGL.getTexUnit(cur_active)->activate();
- }
+ gGL.getTexUnit(cur_active)->activate();
+ }
- glBeginQueryARB(GL_SAMPLES_PASSED, mSamplesQuery);
- glBeginQueryARB(GL_TIME_ELAPSED, mTimerQuery);
+ glBeginQueryARB(GL_SAMPLES_PASSED, mSamplesQuery);
+ glBeginQueryARB(GL_TIME_ELAPSED, mTimerQuery);
#endif
}
void LLGLSLShader::readProfileQuery(U32 count, U32 mode)
{
#if !LL_DARWIN
- glEndQueryARB(GL_TIME_ELAPSED);
- glEndQueryARB(GL_SAMPLES_PASSED);
-
- U64 time_elapsed = 0;
- glGetQueryObjectui64v(mTimerQuery, GL_QUERY_RESULT, &time_elapsed);
-
- U64 samples_passed = 0;
- glGetQueryObjectui64v(mSamplesQuery, GL_QUERY_RESULT, &samples_passed);
-
- sTotalTimeElapsed += time_elapsed;
- mTimeElapsed += time_elapsed;
-
- sTotalSamplesDrawn += samples_passed;
- mSamplesDrawn += samples_passed;
-
- U32 tri_count = 0;
- switch (mode)
- {
- case LLRender::TRIANGLES: tri_count = count/3; break;
- case LLRender::TRIANGLE_FAN: tri_count = count-2; break;
- case LLRender::TRIANGLE_STRIP: tri_count = count-2; break;
- default: tri_count = count; break; //points lines etc just use primitive count
- }
-
- mTrianglesDrawn += tri_count;
- sTotalTrianglesDrawn += tri_count;
-
- sTotalDrawCalls++;
- mDrawCalls++;
+ glEndQueryARB(GL_TIME_ELAPSED);
+ glEndQueryARB(GL_SAMPLES_PASSED);
+
+ U64 time_elapsed = 0;
+ glGetQueryObjectui64v(mTimerQuery, GL_QUERY_RESULT, &time_elapsed);
+
+ U64 samples_passed = 0;
+ glGetQueryObjectui64v(mSamplesQuery, GL_QUERY_RESULT, &samples_passed);
+
+ sTotalTimeElapsed += time_elapsed;
+ mTimeElapsed += time_elapsed;
+
+ sTotalSamplesDrawn += samples_passed;
+ mSamplesDrawn += samples_passed;
+
+ U32 tri_count = 0;
+ switch (mode)
+ {
+ case LLRender::TRIANGLES: tri_count = count/3; break;
+ case LLRender::TRIANGLE_FAN: tri_count = count-2; break;
+ case LLRender::TRIANGLE_STRIP: tri_count = count-2; break;
+ default: tri_count = count; break; //points lines etc just use primitive count
+ }
+
+ mTrianglesDrawn += tri_count;
+ sTotalTrianglesDrawn += tri_count;
+
+ sTotalDrawCalls++;
+ mDrawCalls++;
#endif
}
LLGLSLShader::LLGLSLShader()
- : mProgramObject(0),
- mAttributeMask(0),
- mTotalUniformSize(0),
- mActiveTextureChannels(0),
- mShaderLevel(0),
- mShaderGroup(SG_DEFAULT),
- mUniformsDirty(FALSE),
- mTimerQuery(0),
- mSamplesQuery(0)
+ : mProgramObject(0),
+ mAttributeMask(0),
+ mTotalUniformSize(0),
+ mActiveTextureChannels(0),
+ mShaderLevel(0),
+ mShaderGroup(SG_DEFAULT),
+ mUniformsDirty(FALSE),
+ mTimerQuery(0),
+ mSamplesQuery(0)
{
-
+
}
LLGLSLShader::~LLGLSLShader()
@@ -325,1077 +325,1077 @@ LLGLSLShader::~LLGLSLShader()
void LLGLSLShader::unload()
{
- sInstances.erase(this);
-
- stop_glerror();
- mAttribute.clear();
- mTexture.clear();
- mUniform.clear();
- mShaderFiles.clear();
- mDefines.clear();
-
- if (mProgramObject)
- {
- GLhandleARB obj[1024];
- GLsizei count;
-
- glGetAttachedObjectsARB(mProgramObject, 1024, &count, obj);
- for (GLsizei i = 0; i < count; i++)
- {
+ sInstances.erase(this);
+
+ stop_glerror();
+ mAttribute.clear();
+ mTexture.clear();
+ mUniform.clear();
+ mShaderFiles.clear();
+ mDefines.clear();
+
+ if (mProgramObject)
+ {
+ GLhandleARB obj[1024];
+ GLsizei count;
+
+ glGetAttachedObjectsARB(mProgramObject, 1024, &count, obj);
+ for (GLsizei i = 0; i < count; i++)
+ {
#if !LL_DARWIN
- if (glIsProgramARB(obj[i]))
+ if (glIsProgramARB(obj[i]))
#endif
- {
- glDeleteObjectARB(obj[i]);
- }
- }
-
- glDeleteObjectARB(mProgramObject);
-
- mProgramObject = 0;
- }
-
- if (mTimerQuery)
- {
- glDeleteQueriesARB(1, &mTimerQuery);
- mTimerQuery = 0;
- }
-
- if (mSamplesQuery)
- {
- glDeleteQueriesARB(1, &mSamplesQuery);
- mSamplesQuery = 0;
- }
-
- //hack to make apple not complain
- glGetError();
-
- stop_glerror();
+ {
+ glDeleteObjectARB(obj[i]);
+ }
+ }
+
+ glDeleteObjectARB(mProgramObject);
+
+ mProgramObject = 0;
+ }
+
+ if (mTimerQuery)
+ {
+ glDeleteQueriesARB(1, &mTimerQuery);
+ mTimerQuery = 0;
+ }
+
+ if (mSamplesQuery)
+ {
+ glDeleteQueriesARB(1, &mSamplesQuery);
+ mSamplesQuery = 0;
+ }
+
+ //hack to make apple not complain
+ glGetError();
+
+ stop_glerror();
}
BOOL LLGLSLShader::createShader(std::vector<LLStaticHashedString> * attributes,
- std::vector<LLStaticHashedString> * uniforms,
- U32 varying_count,
- const char** varyings)
+ std::vector<LLStaticHashedString> * uniforms,
+ U32 varying_count,
+ const char** varyings)
{
- sInstances.insert(this);
+ sInstances.insert(this);
- //reloading, reset matrix hash values
- for (U32 i = 0; i < LLRender::NUM_MATRIX_MODES; ++i)
- {
- mMatHash[i] = 0xFFFFFFFF;
- }
- mLightHash = 0xFFFFFFFF;
+ //reloading, reset matrix hash values
+ for (U32 i = 0; i < LLRender::NUM_MATRIX_MODES; ++i)
+ {
+ mMatHash[i] = 0xFFFFFFFF;
+ }
+ mLightHash = 0xFFFFFFFF;
- llassert_always(!mShaderFiles.empty());
- BOOL success = TRUE;
+ llassert_always(!mShaderFiles.empty());
+ BOOL success = TRUE;
- // Create program
- mProgramObject = glCreateProgramObjectARB();
-
+ // Create program
+ mProgramObject = glCreateProgramObjectARB();
+
#if LL_DARWIN
// work-around missing mix(vec3,vec3,bvec3)
mDefines["OLD_SELECT"] = "1";
#endif
-
- //compile new source
- vector< pair<string,GLenum> >::iterator fileIter = mShaderFiles.begin();
- for ( ; fileIter != mShaderFiles.end(); fileIter++ )
- {
- GLhandleARB shaderhandle = LLShaderMgr::instance()->loadShaderFile((*fileIter).first, mShaderLevel, (*fileIter).second, &mDefines, mFeatures.mIndexedTextureChannels);
- LL_DEBUGS("ShaderLoading") << "SHADER FILE: " << (*fileIter).first << " mShaderLevel=" << mShaderLevel << LL_ENDL;
- if (shaderhandle > 0)
- {
- attachObject(shaderhandle);
- }
- else
- {
- success = FALSE;
- }
- }
-
- // Attach existing objects
- if (!LLShaderMgr::instance()->attachShaderFeatures(this))
- {
- return FALSE;
- }
-
- if (gGLManager.mGLSLVersionMajor < 2 && gGLManager.mGLSLVersionMinor < 3)
- { //indexed texture rendering requires GLSL 1.3 or later
- //attachShaderFeatures may have set the number of indexed texture channels, so set to 1 again
- mFeatures.mIndexedTextureChannels = llmin(mFeatures.mIndexedTextureChannels, 1);
- }
+
+ //compile new source
+ vector< pair<string,GLenum> >::iterator fileIter = mShaderFiles.begin();
+ for ( ; fileIter != mShaderFiles.end(); fileIter++ )
+ {
+ GLhandleARB shaderhandle = LLShaderMgr::instance()->loadShaderFile((*fileIter).first, mShaderLevel, (*fileIter).second, &mDefines, mFeatures.mIndexedTextureChannels);
+ LL_DEBUGS("ShaderLoading") << "SHADER FILE: " << (*fileIter).first << " mShaderLevel=" << mShaderLevel << LL_ENDL;
+ if (shaderhandle > 0)
+ {
+ attachObject(shaderhandle);
+ }
+ else
+ {
+ success = FALSE;
+ }
+ }
+
+ // Attach existing objects
+ if (!LLShaderMgr::instance()->attachShaderFeatures(this))
+ {
+ return FALSE;
+ }
+
+ if (gGLManager.mGLSLVersionMajor < 2 && gGLManager.mGLSLVersionMinor < 3)
+ { //indexed texture rendering requires GLSL 1.3 or later
+ //attachShaderFeatures may have set the number of indexed texture channels, so set to 1 again
+ mFeatures.mIndexedTextureChannels = llmin(mFeatures.mIndexedTextureChannels, 1);
+ }
#ifdef GL_INTERLEAVED_ATTRIBS
- if (varying_count > 0 && varyings)
- {
- glTransformFeedbackVaryings(mProgramObject, varying_count, varyings, GL_INTERLEAVED_ATTRIBS);
- }
+ if (varying_count > 0 && varyings)
+ {
+ glTransformFeedbackVaryings(mProgramObject, varying_count, varyings, GL_INTERLEAVED_ATTRIBS);
+ }
#endif
- // Map attributes and uniforms
- if (success)
- {
- success = mapAttributes(attributes);
- }
- if (success)
- {
- success = mapUniforms(uniforms);
- }
- if( !success )
- {
- LL_WARNS("ShaderLoading") << "Failed to link shader: " << mName << LL_ENDL;
-
- // Try again using a lower shader level;
- if (mShaderLevel > 0)
- {
- LL_WARNS("ShaderLoading") << "Failed to link using shader level " << mShaderLevel << " trying again using shader level " << (mShaderLevel - 1) << LL_ENDL;
- mShaderLevel--;
- return createShader(attributes,uniforms);
- }
- }
- else if (mFeatures.mIndexedTextureChannels > 0)
- { //override texture channels for indexed texture rendering
- bind();
- S32 channel_count = mFeatures.mIndexedTextureChannels;
-
- for (S32 i = 0; i < channel_count; i++)
- {
- LLStaticHashedString uniName(llformat("tex%d", i));
- uniform1i(uniName, i);
- }
-
- S32 cur_tex = channel_count; //adjust any texture channels that might have been overwritten
- for (U32 i = 0; i < mTexture.size(); i++)
- {
- if (mTexture[i] > -1 && mTexture[i] < channel_count)
- {
- llassert(cur_tex < gGLManager.mNumTextureImageUnits);
- uniform1i(i, cur_tex);
- mTexture[i] = cur_tex++;
- }
- }
- unbind();
- }
-
- return success;
+ // Map attributes and uniforms
+ if (success)
+ {
+ success = mapAttributes(attributes);
+ }
+ if (success)
+ {
+ success = mapUniforms(uniforms);
+ }
+ if( !success )
+ {
+ LL_WARNS("ShaderLoading") << "Failed to link shader: " << mName << LL_ENDL;
+
+ // Try again using a lower shader level;
+ if (mShaderLevel > 0)
+ {
+ LL_WARNS("ShaderLoading") << "Failed to link using shader level " << mShaderLevel << " trying again using shader level " << (mShaderLevel - 1) << LL_ENDL;
+ mShaderLevel--;
+ return createShader(attributes,uniforms);
+ }
+ }
+ else if (mFeatures.mIndexedTextureChannels > 0)
+ { //override texture channels for indexed texture rendering
+ bind();
+ S32 channel_count = mFeatures.mIndexedTextureChannels;
+
+ for (S32 i = 0; i < channel_count; i++)
+ {
+ LLStaticHashedString uniName(llformat("tex%d", i));
+ uniform1i(uniName, i);
+ }
+
+ S32 cur_tex = channel_count; //adjust any texture channels that might have been overwritten
+ for (U32 i = 0; i < mTexture.size(); i++)
+ {
+ if (mTexture[i] > -1 && mTexture[i] < channel_count)
+ {
+ llassert(cur_tex < gGLManager.mNumTextureImageUnits);
+ uniform1i(i, cur_tex);
+ mTexture[i] = cur_tex++;
+ }
+ }
+ unbind();
+ }
+
+ return success;
}
BOOL LLGLSLShader::attachObject(std::string object)
{
- if (LLShaderMgr::instance()->mShaderObjects.count(object) > 0)
- {
- stop_glerror();
- glAttachObjectARB(mProgramObject, LLShaderMgr::instance()->mShaderObjects[object]);
- stop_glerror();
- return TRUE;
- }
- else
- {
- LL_WARNS("ShaderLoading") << "Attempting to attach shader object that hasn't been compiled: " << object << LL_ENDL;
- return FALSE;
- }
+ if (LLShaderMgr::instance()->mShaderObjects.count(object) > 0)
+ {
+ stop_glerror();
+ glAttachObjectARB(mProgramObject, LLShaderMgr::instance()->mShaderObjects[object]);
+ stop_glerror();
+ return TRUE;
+ }
+ else
+ {
+ LL_WARNS("ShaderLoading") << "Attempting to attach shader object that hasn't been compiled: " << object << LL_ENDL;
+ return FALSE;
+ }
}
void LLGLSLShader::attachObject(GLhandleARB object)
{
- if (object != 0)
- {
- stop_glerror();
- glAttachObjectARB(mProgramObject, object);
- stop_glerror();
- }
- else
- {
- LL_WARNS("ShaderLoading") << "Attempting to attach non existing shader object. " << LL_ENDL;
- }
+ if (object != 0)
+ {
+ stop_glerror();
+ glAttachObjectARB(mProgramObject, object);
+ stop_glerror();
+ }
+ else
+ {
+ LL_WARNS("ShaderLoading") << "Attempting to attach non existing shader object. " << LL_ENDL;
+ }
}
void LLGLSLShader::attachObjects(GLhandleARB* objects, S32 count)
{
- for (S32 i = 0; i < count; i++)
- {
- attachObject(objects[i]);
- }
+ for (S32 i = 0; i < count; i++)
+ {
+ attachObject(objects[i]);
+ }
}
BOOL LLGLSLShader::mapAttributes(const std::vector<LLStaticHashedString> * attributes)
{
- //before linking, make sure reserved attributes always have consistent locations
- for (U32 i = 0; i < LLShaderMgr::instance()->mReservedAttribs.size(); i++)
- {
- const char* name = LLShaderMgr::instance()->mReservedAttribs[i].c_str();
- glBindAttribLocationARB(mProgramObject, i, (const GLcharARB *) name);
- }
-
- //link the program
- BOOL res = link();
-
- mAttribute.clear();
- U32 numAttributes = (attributes == NULL) ? 0 : attributes->size();
- mAttribute.resize(LLShaderMgr::instance()->mReservedAttribs.size() + numAttributes, -1);
-
- if (res)
- { //read back channel locations
-
- mAttributeMask = 0;
-
- //read back reserved channels first
- for (U32 i = 0; i < LLShaderMgr::instance()->mReservedAttribs.size(); i++)
- {
- const char* name = LLShaderMgr::instance()->mReservedAttribs[i].c_str();
- S32 index = glGetAttribLocationARB(mProgramObject, (const GLcharARB *)name);
- if (index != -1)
- {
- mAttribute[i] = index;
- mAttributeMask |= 1 << i;
- LL_DEBUGS("ShaderLoading") << "Attribute " << name << " assigned to channel " << index << LL_ENDL;
- }
- }
- if (attributes != NULL)
- {
- for (U32 i = 0; i < numAttributes; i++)
- {
- const char* name = (*attributes)[i].String().c_str();
- S32 index = glGetAttribLocationARB(mProgramObject, name);
- if (index != -1)
- {
- mAttribute[LLShaderMgr::instance()->mReservedAttribs.size() + i] = index;
- LL_DEBUGS("ShaderLoading") << "Attribute " << name << " assigned to channel " << index << LL_ENDL;
- }
- }
- }
-
- return TRUE;
- }
-
- return FALSE;
+ //before linking, make sure reserved attributes always have consistent locations
+ for (U32 i = 0; i < LLShaderMgr::instance()->mReservedAttribs.size(); i++)
+ {
+ const char* name = LLShaderMgr::instance()->mReservedAttribs[i].c_str();
+ glBindAttribLocationARB(mProgramObject, i, (const GLcharARB *) name);
+ }
+
+ //link the program
+ BOOL res = link();
+
+ mAttribute.clear();
+ U32 numAttributes = (attributes == NULL) ? 0 : attributes->size();
+ mAttribute.resize(LLShaderMgr::instance()->mReservedAttribs.size() + numAttributes, -1);
+
+ if (res)
+ { //read back channel locations
+
+ mAttributeMask = 0;
+
+ //read back reserved channels first
+ for (U32 i = 0; i < LLShaderMgr::instance()->mReservedAttribs.size(); i++)
+ {
+ const char* name = LLShaderMgr::instance()->mReservedAttribs[i].c_str();
+ S32 index = glGetAttribLocationARB(mProgramObject, (const GLcharARB *)name);
+ if (index != -1)
+ {
+ mAttribute[i] = index;
+ mAttributeMask |= 1 << i;
+ LL_DEBUGS("ShaderLoading") << "Attribute " << name << " assigned to channel " << index << LL_ENDL;
+ }
+ }
+ if (attributes != NULL)
+ {
+ for (U32 i = 0; i < numAttributes; i++)
+ {
+ const char* name = (*attributes)[i].String().c_str();
+ S32 index = glGetAttribLocationARB(mProgramObject, name);
+ if (index != -1)
+ {
+ mAttribute[LLShaderMgr::instance()->mReservedAttribs.size() + i] = index;
+ LL_DEBUGS("ShaderLoading") << "Attribute " << name << " assigned to channel " << index << LL_ENDL;
+ }
+ }
+ }
+
+ return TRUE;
+ }
+
+ return FALSE;
}
void LLGLSLShader::mapUniform(GLint index, const vector<LLStaticHashedString> * uniforms)
{
- if (index == -1)
- {
- return;
- }
+ if (index == -1)
+ {
+ return;
+ }
- GLenum type;
- GLsizei length;
- GLint size = -1;
- char name[1024]; /* Flawfinder: ignore */
- name[0] = 0;
+ GLenum type;
+ GLsizei length;
+ GLint size = -1;
+ char name[1024]; /* Flawfinder: ignore */
+ name[0] = 0;
- glGetActiveUniformARB(mProgramObject, index, 1024, &length, &size, &type, (GLcharARB *)name);
+ glGetActiveUniformARB(mProgramObject, index, 1024, &length, &size, &type, (GLcharARB *)name);
#if !LL_DARWIN
- if (size > 0)
- {
- switch(type)
- {
- case GL_FLOAT_VEC2: size *= 2; break;
- case GL_FLOAT_VEC3: size *= 3; break;
- case GL_FLOAT_VEC4: size *= 4; break;
- case GL_DOUBLE: size *= 2; break;
- case GL_DOUBLE_VEC2: size *= 2; break;
- case GL_DOUBLE_VEC3: size *= 6; break;
- case GL_DOUBLE_VEC4: size *= 8; break;
- case GL_INT_VEC2: size *= 2; break;
- case GL_INT_VEC3: size *= 3; break;
- case GL_INT_VEC4: size *= 4; break;
- case GL_UNSIGNED_INT_VEC2: size *= 2; break;
- case GL_UNSIGNED_INT_VEC3: size *= 3; break;
- case GL_UNSIGNED_INT_VEC4: size *= 4; break;
- case GL_BOOL_VEC2: size *= 2; break;
- case GL_BOOL_VEC3: size *= 3; break;
- case GL_BOOL_VEC4: size *= 4; break;
- case GL_FLOAT_MAT2: size *= 4; break;
- case GL_FLOAT_MAT3: size *= 9; break;
- case GL_FLOAT_MAT4: size *= 16; break;
- case GL_FLOAT_MAT2x3: size *= 6; break;
- case GL_FLOAT_MAT2x4: size *= 8; break;
- case GL_FLOAT_MAT3x2: size *= 6; break;
- case GL_FLOAT_MAT3x4: size *= 12; break;
- case GL_FLOAT_MAT4x2: size *= 8; break;
- case GL_FLOAT_MAT4x3: size *= 12; break;
- case GL_DOUBLE_MAT2: size *= 8; break;
- case GL_DOUBLE_MAT3: size *= 18; break;
- case GL_DOUBLE_MAT4: size *= 32; break;
- case GL_DOUBLE_MAT2x3: size *= 12; break;
- case GL_DOUBLE_MAT2x4: size *= 16; break;
- case GL_DOUBLE_MAT3x2: size *= 12; break;
- case GL_DOUBLE_MAT3x4: size *= 24; break;
- case GL_DOUBLE_MAT4x2: size *= 16; break;
- case GL_DOUBLE_MAT4x3: size *= 24; break;
- }
- mTotalUniformSize += size;
- }
+ if (size > 0)
+ {
+ switch(type)
+ {
+ case GL_FLOAT_VEC2: size *= 2; break;
+ case GL_FLOAT_VEC3: size *= 3; break;
+ case GL_FLOAT_VEC4: size *= 4; break;
+ case GL_DOUBLE: size *= 2; break;
+ case GL_DOUBLE_VEC2: size *= 2; break;
+ case GL_DOUBLE_VEC3: size *= 6; break;
+ case GL_DOUBLE_VEC4: size *= 8; break;
+ case GL_INT_VEC2: size *= 2; break;
+ case GL_INT_VEC3: size *= 3; break;
+ case GL_INT_VEC4: size *= 4; break;
+ case GL_UNSIGNED_INT_VEC2: size *= 2; break;
+ case GL_UNSIGNED_INT_VEC3: size *= 3; break;
+ case GL_UNSIGNED_INT_VEC4: size *= 4; break;
+ case GL_BOOL_VEC2: size *= 2; break;
+ case GL_BOOL_VEC3: size *= 3; break;
+ case GL_BOOL_VEC4: size *= 4; break;
+ case GL_FLOAT_MAT2: size *= 4; break;
+ case GL_FLOAT_MAT3: size *= 9; break;
+ case GL_FLOAT_MAT4: size *= 16; break;
+ case GL_FLOAT_MAT2x3: size *= 6; break;
+ case GL_FLOAT_MAT2x4: size *= 8; break;
+ case GL_FLOAT_MAT3x2: size *= 6; break;
+ case GL_FLOAT_MAT3x4: size *= 12; break;
+ case GL_FLOAT_MAT4x2: size *= 8; break;
+ case GL_FLOAT_MAT4x3: size *= 12; break;
+ case GL_DOUBLE_MAT2: size *= 8; break;
+ case GL_DOUBLE_MAT3: size *= 18; break;
+ case GL_DOUBLE_MAT4: size *= 32; break;
+ case GL_DOUBLE_MAT2x3: size *= 12; break;
+ case GL_DOUBLE_MAT2x4: size *= 16; break;
+ case GL_DOUBLE_MAT3x2: size *= 12; break;
+ case GL_DOUBLE_MAT3x4: size *= 24; break;
+ case GL_DOUBLE_MAT4x2: size *= 16; break;
+ case GL_DOUBLE_MAT4x3: size *= 24; break;
+ }
+ mTotalUniformSize += size;
+ }
#endif
- S32 location = glGetUniformLocationARB(mProgramObject, name);
- if (location != -1)
- {
- //chop off "[0]" so we can always access the first element
- //of an array by the array name
- char* is_array = strstr(name, "[0]");
- if (is_array)
- {
- is_array[0] = 0;
- }
-
- LLStaticHashedString hashedName(name);
- mUniformNameMap[location] = name;
- mUniformMap[hashedName] = location;
-
- LL_DEBUGS("ShaderLoading") << "Uniform " << name << " is at location " << location << LL_ENDL;
-
- //find the index of this uniform
- for (S32 i = 0; i < (S32) LLShaderMgr::instance()->mReservedUniforms.size(); i++)
- {
- if ( (mUniform[i] == -1)
- && (LLShaderMgr::instance()->mReservedUniforms[i] == name))
- {
- //found it
- mUniform[i] = location;
- mTexture[i] = mapUniformTextureChannel(location, type);
- return;
- }
- }
-
- if (uniforms != NULL)
- {
- for (U32 i = 0; i < uniforms->size(); i++)
- {
- if ( (mUniform[i+LLShaderMgr::instance()->mReservedUniforms.size()] == -1)
- && ((*uniforms)[i].String() == name))
- {
- //found it
- mUniform[i+LLShaderMgr::instance()->mReservedUniforms.size()] = location;
- mTexture[i+LLShaderMgr::instance()->mReservedUniforms.size()] = mapUniformTextureChannel(location, type);
- return;
- }
- }
- }
- }
+ S32 location = glGetUniformLocationARB(mProgramObject, name);
+ if (location != -1)
+ {
+ //chop off "[0]" so we can always access the first element
+ //of an array by the array name
+ char* is_array = strstr(name, "[0]");
+ if (is_array)
+ {
+ is_array[0] = 0;
+ }
+
+ LLStaticHashedString hashedName(name);
+ mUniformNameMap[location] = name;
+ mUniformMap[hashedName] = location;
+
+ LL_DEBUGS("ShaderLoading") << "Uniform " << name << " is at location " << location << LL_ENDL;
+
+ //find the index of this uniform
+ for (S32 i = 0; i < (S32) LLShaderMgr::instance()->mReservedUniforms.size(); i++)
+ {
+ if ( (mUniform[i] == -1)
+ && (LLShaderMgr::instance()->mReservedUniforms[i] == name))
+ {
+ //found it
+ mUniform[i] = location;
+ mTexture[i] = mapUniformTextureChannel(location, type);
+ return;
+ }
+ }
+
+ if (uniforms != NULL)
+ {
+ for (U32 i = 0; i < uniforms->size(); i++)
+ {
+ if ( (mUniform[i+LLShaderMgr::instance()->mReservedUniforms.size()] == -1)
+ && ((*uniforms)[i].String() == name))
+ {
+ //found it
+ mUniform[i+LLShaderMgr::instance()->mReservedUniforms.size()] = location;
+ mTexture[i+LLShaderMgr::instance()->mReservedUniforms.size()] = mapUniformTextureChannel(location, type);
+ return;
+ }
+ }
+ }
+ }
}
void LLGLSLShader::addPermutation(std::string name, std::string value)
{
- mDefines[name] = value;
+ mDefines[name] = value;
}
void LLGLSLShader::removePermutation(std::string name)
{
- mDefines[name].erase();
+ mDefines[name].erase();
}
GLint LLGLSLShader::mapUniformTextureChannel(GLint location, GLenum type)
{
- if ((type >= GL_SAMPLER_1D_ARB && type <= GL_SAMPLER_2D_RECT_SHADOW_ARB) ||
- type == GL_SAMPLER_2D_MULTISAMPLE)
- { //this here is a texture
- glUniform1iARB(location, mActiveTextureChannels);
- LL_DEBUGS("ShaderLoading") << "Assigned to texture channel " << mActiveTextureChannels << LL_ENDL;
- return mActiveTextureChannels++;
- }
- return -1;
+ if ((type >= GL_SAMPLER_1D_ARB && type <= GL_SAMPLER_2D_RECT_SHADOW_ARB) ||
+ type == GL_SAMPLER_2D_MULTISAMPLE)
+ { //this here is a texture
+ glUniform1iARB(location, mActiveTextureChannels);
+ LL_DEBUGS("ShaderLoading") << "Assigned to texture channel " << mActiveTextureChannels << LL_ENDL;
+ return mActiveTextureChannels++;
+ }
+ return -1;
}
BOOL LLGLSLShader::mapUniforms(const vector<LLStaticHashedString> * uniforms)
{
- BOOL res = TRUE;
-
- mTotalUniformSize = 0;
- mActiveTextureChannels = 0;
- mUniform.clear();
- mUniformMap.clear();
- mUniformNameMap.clear();
- mTexture.clear();
- mValue.clear();
- //initialize arrays
- U32 numUniforms = (uniforms == NULL) ? 0 : uniforms->size();
- mUniform.resize(numUniforms + LLShaderMgr::instance()->mReservedUniforms.size(), -1);
- mTexture.resize(numUniforms + LLShaderMgr::instance()->mReservedUniforms.size(), -1);
-
- bind();
-
- //get the number of active uniforms
- GLint activeCount;
- glGetObjectParameterivARB(mProgramObject, GL_OBJECT_ACTIVE_UNIFORMS_ARB, &activeCount);
-
- for (S32 i = 0; i < activeCount; i++)
- {
- mapUniform(i, uniforms);
- }
-
- unbind();
-
- LL_DEBUGS("ShaderLoading") << "Total Uniform Size: " << mTotalUniformSize << LL_ENDL;
- return res;
+ BOOL res = TRUE;
+
+ mTotalUniformSize = 0;
+ mActiveTextureChannels = 0;
+ mUniform.clear();
+ mUniformMap.clear();
+ mUniformNameMap.clear();
+ mTexture.clear();
+ mValue.clear();
+ //initialize arrays
+ U32 numUniforms = (uniforms == NULL) ? 0 : uniforms->size();
+ mUniform.resize(numUniforms + LLShaderMgr::instance()->mReservedUniforms.size(), -1);
+ mTexture.resize(numUniforms + LLShaderMgr::instance()->mReservedUniforms.size(), -1);
+
+ bind();
+
+ //get the number of active uniforms
+ GLint activeCount;
+ glGetObjectParameterivARB(mProgramObject, GL_OBJECT_ACTIVE_UNIFORMS_ARB, &activeCount);
+
+ for (S32 i = 0; i < activeCount; i++)
+ {
+ mapUniform(i, uniforms);
+ }
+
+ unbind();
+
+ LL_DEBUGS("ShaderLoading") << "Total Uniform Size: " << mTotalUniformSize << LL_ENDL;
+ return res;
}
BOOL LLGLSLShader::link(BOOL suppress_errors)
{
- BOOL success = LLShaderMgr::instance()->linkProgramObject(mProgramObject, suppress_errors);
+ BOOL success = LLShaderMgr::instance()->linkProgramObject(mProgramObject, suppress_errors);
- if (!suppress_errors)
- {
+ if (!suppress_errors)
+ {
LLShaderMgr::instance()->dumpObjectLog(mProgramObject, !success, mName);
- }
+ }
- return success;
+ return success;
}
void LLGLSLShader::bind()
{
- gGL.flush();
- if (gGLManager.mHasShaderObjects)
- {
- LLVertexBuffer::unbind();
- glUseProgramObjectARB(mProgramObject);
- sCurBoundShader = mProgramObject;
- sCurBoundShaderPtr = this;
- if (mUniformsDirty)
- {
- LLShaderMgr::instance()->updateShaderUniforms(this);
- mUniformsDirty = FALSE;
- }
- }
+ gGL.flush();
+ if (gGLManager.mHasShaderObjects)
+ {
+ LLVertexBuffer::unbind();
+ glUseProgramObjectARB(mProgramObject);
+ sCurBoundShader = mProgramObject;
+ sCurBoundShaderPtr = this;
+ if (mUniformsDirty)
+ {
+ LLShaderMgr::instance()->updateShaderUniforms(this);
+ mUniformsDirty = FALSE;
+ }
+ }
}
void LLGLSLShader::unbind()
{
- gGL.flush();
- if (gGLManager.mHasShaderObjects)
- {
- stop_glerror();
- if (gGLManager.mIsNVIDIA)
- {
- for (U32 i = 0; i < mAttribute.size(); ++i)
- {
- vertexAttrib4f(i, 0,0,0,1);
- stop_glerror();
- }
- }
- LLVertexBuffer::unbind();
- glUseProgramObjectARB(0);
- sCurBoundShader = 0;
- sCurBoundShaderPtr = NULL;
- stop_glerror();
- }
+ gGL.flush();
+ if (gGLManager.mHasShaderObjects)
+ {
+ stop_glerror();
+ if (gGLManager.mIsNVIDIA)
+ {
+ for (U32 i = 0; i < mAttribute.size(); ++i)
+ {
+ vertexAttrib4f(i, 0,0,0,1);
+ stop_glerror();
+ }
+ }
+ LLVertexBuffer::unbind();
+ glUseProgramObjectARB(0);
+ sCurBoundShader = 0;
+ sCurBoundShaderPtr = NULL;
+ stop_glerror();
+ }
}
void LLGLSLShader::bindNoShader(void)
{
- LLVertexBuffer::unbind();
- if (gGLManager.mHasShaderObjects)
- {
- glUseProgramObjectARB(0);
- sCurBoundShader = 0;
- sCurBoundShaderPtr = NULL;
- }
+ LLVertexBuffer::unbind();
+ if (gGLManager.mHasShaderObjects)
+ {
+ glUseProgramObjectARB(0);
+ sCurBoundShader = 0;
+ sCurBoundShaderPtr = NULL;
+ }
}
S32 LLGLSLShader::bindTexture(const std::string &uniform, LLTexture *texture, LLTexUnit::eTextureType mode)
{
- S32 channel = 0;
- channel = getUniformLocation(uniform);
-
- return bindTexture(channel, texture, mode);
+ S32 channel = 0;
+ channel = getUniformLocation(uniform);
+
+ return bindTexture(channel, texture, mode);
}
S32 LLGLSLShader::bindTexture(S32 uniform, LLTexture *texture, LLTexUnit::eTextureType mode)
{
- if (uniform < 0 || uniform >= (S32)mTexture.size())
- {
- UNIFORM_ERRS << "Uniform out of range: " << uniform << LL_ENDL;
- return -1;
- }
-
- uniform = mTexture[uniform];
-
- if (uniform > -1)
- {
- gGL.getTexUnit(uniform)->bind(texture, mode);
- }
-
- return uniform;
+ if (uniform < 0 || uniform >= (S32)mTexture.size())
+ {
+ UNIFORM_ERRS << "Uniform out of range: " << uniform << LL_ENDL;
+ return -1;
+ }
+
+ uniform = mTexture[uniform];
+
+ if (uniform > -1)
+ {
+ gGL.getTexUnit(uniform)->bind(texture, mode);
+ }
+
+ return uniform;
}
S32 LLGLSLShader::unbindTexture(const std::string &uniform, LLTexUnit::eTextureType mode)
{
- S32 channel = 0;
- channel = getUniformLocation(uniform);
-
- return unbindTexture(channel);
+ S32 channel = 0;
+ channel = getUniformLocation(uniform);
+
+ return unbindTexture(channel);
}
S32 LLGLSLShader::unbindTexture(S32 uniform, LLTexUnit::eTextureType mode)
{
- if (uniform < 0 || uniform >= (S32)mTexture.size())
- {
- UNIFORM_ERRS << "Uniform out of range: " << uniform << LL_ENDL;
- return -1;
- }
-
- uniform = mTexture[uniform];
-
- if (uniform > -1)
- {
- gGL.getTexUnit(uniform)->unbind(mode);
- }
-
- return uniform;
+ if (uniform < 0 || uniform >= (S32)mTexture.size())
+ {
+ UNIFORM_ERRS << "Uniform out of range: " << uniform << LL_ENDL;
+ return -1;
+ }
+
+ uniform = mTexture[uniform];
+
+ if (uniform > -1)
+ {
+ gGL.getTexUnit(uniform)->unbind(mode);
+ }
+
+ return uniform;
}
S32 LLGLSLShader::enableTexture(S32 uniform, LLTexUnit::eTextureType mode)
{
- if (uniform < 0 || uniform >= (S32)mTexture.size())
- {
- UNIFORM_ERRS << "Uniform out of range: " << uniform << LL_ENDL;
- return -1;
- }
- S32 index = mTexture[uniform];
- if (index != -1)
- {
- gGL.getTexUnit(index)->activate();
- gGL.getTexUnit(index)->enable(mode);
- }
- return index;
+ if (uniform < 0 || uniform >= (S32)mTexture.size())
+ {
+ UNIFORM_ERRS << "Uniform out of range: " << uniform << LL_ENDL;
+ return -1;
+ }
+ S32 index = mTexture[uniform];
+ if (index != -1)
+ {
+ gGL.getTexUnit(index)->activate();
+ gGL.getTexUnit(index)->enable(mode);
+ }
+ return index;
}
S32 LLGLSLShader::disableTexture(S32 uniform, LLTexUnit::eTextureType mode)
{
- if (uniform < 0 || uniform >= (S32)mTexture.size())
- {
- UNIFORM_ERRS << "Uniform out of range: " << uniform << LL_ENDL;
- return -1;
- }
- S32 index = mTexture[uniform];
- if (index != -1 && gGL.getTexUnit(index)->getCurrType() != LLTexUnit::TT_NONE)
- {
- if (gDebugGL && gGL.getTexUnit(index)->getCurrType() != mode)
- {
- if (gDebugSession)
- {
- gFailLog << "Texture channel " << index << " texture type corrupted." << std::endl;
- ll_fail("LLGLSLShader::disableTexture failed");
- }
- else
- {
- LL_ERRS() << "Texture channel " << index << " texture type corrupted." << LL_ENDL;
- }
- }
- gGL.getTexUnit(index)->disable();
- }
- return index;
+ if (uniform < 0 || uniform >= (S32)mTexture.size())
+ {
+ UNIFORM_ERRS << "Uniform out of range: " << uniform << LL_ENDL;
+ return -1;
+ }
+ S32 index = mTexture[uniform];
+ if (index != -1 && gGL.getTexUnit(index)->getCurrType() != LLTexUnit::TT_NONE)
+ {
+ if (gDebugGL && gGL.getTexUnit(index)->getCurrType() != mode)
+ {
+ if (gDebugSession)
+ {
+ gFailLog << "Texture channel " << index << " texture type corrupted." << std::endl;
+ ll_fail("LLGLSLShader::disableTexture failed");
+ }
+ else
+ {
+ LL_ERRS() << "Texture channel " << index << " texture type corrupted." << LL_ENDL;
+ }
+ }
+ gGL.getTexUnit(index)->disable();
+ }
+ return index;
}
void LLGLSLShader::uniform1i(U32 index, GLint x)
{
- if (mProgramObject > 0)
- {
- if (mUniform.size() <= index)
- {
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
- return;
- }
-
- if (mUniform[index] >= 0)
- {
- std::map<GLint, LLVector4>::iterator iter = mValue.find(mUniform[index]);
- if (iter == mValue.end() || iter->second.mV[0] != x)
- {
- glUniform1iARB(mUniform[index], x);
- mValue[mUniform[index]] = LLVector4(x,0.f,0.f,0.f);
- }
- }
- }
+ if (mProgramObject > 0)
+ {
+ if (mUniform.size() <= index)
+ {
+ UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ return;
+ }
+
+ if (mUniform[index] >= 0)
+ {
+ std::map<GLint, LLVector4>::iterator iter = mValue.find(mUniform[index]);
+ if (iter == mValue.end() || iter->second.mV[0] != x)
+ {
+ glUniform1iARB(mUniform[index], x);
+ mValue[mUniform[index]] = LLVector4(x,0.f,0.f,0.f);
+ }
+ }
+ }
}
void LLGLSLShader::uniform1f(U32 index, GLfloat x)
{
- if (mProgramObject > 0)
- {
- if (mUniform.size() <= index)
- {
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
- return;
- }
-
- if (mUniform[index] >= 0)
- {
- std::map<GLint, LLVector4>::iterator iter = mValue.find(mUniform[index]);
- if (iter == mValue.end() || iter->second.mV[0] != x)
- {
- glUniform1fARB(mUniform[index], x);
- mValue[mUniform[index]] = LLVector4(x,0.f,0.f,0.f);
- }
- }
- }
+ if (mProgramObject > 0)
+ {
+ if (mUniform.size() <= index)
+ {
+ UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ return;
+ }
+
+ if (mUniform[index] >= 0)
+ {
+ std::map<GLint, LLVector4>::iterator iter = mValue.find(mUniform[index]);
+ if (iter == mValue.end() || iter->second.mV[0] != x)
+ {
+ glUniform1fARB(mUniform[index], x);
+ mValue[mUniform[index]] = LLVector4(x,0.f,0.f,0.f);
+ }
+ }
+ }
}
void LLGLSLShader::uniform2f(U32 index, GLfloat x, GLfloat y)
{
- if (mProgramObject > 0)
- {
- if (mUniform.size() <= index)
- {
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
- return;
- }
-
- if (mUniform[index] >= 0)
- {
- std::map<GLint, LLVector4>::iterator iter = mValue.find(mUniform[index]);
- LLVector4 vec(x,y,0.f,0.f);
- if (iter == mValue.end() || shouldChange(iter->second,vec))
- {
- glUniform2fARB(mUniform[index], x, y);
- mValue[mUniform[index]] = vec;
- }
- }
- }
+ if (mProgramObject > 0)
+ {
+ if (mUniform.size() <= index)
+ {
+ UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ return;
+ }
+
+ if (mUniform[index] >= 0)
+ {
+ std::map<GLint, LLVector4>::iterator iter = mValue.find(mUniform[index]);
+ LLVector4 vec(x,y,0.f,0.f);
+ if (iter == mValue.end() || shouldChange(iter->second,vec))
+ {
+ glUniform2fARB(mUniform[index], x, y);
+ mValue[mUniform[index]] = vec;
+ }
+ }
+ }
}
void LLGLSLShader::uniform3f(U32 index, GLfloat x, GLfloat y, GLfloat z)
{
- if (mProgramObject > 0)
- {
- if (mUniform.size() <= index)
- {
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
- return;
- }
-
- if (mUniform[index] >= 0)
- {
- std::map<GLint, LLVector4>::iterator iter = mValue.find(mUniform[index]);
- LLVector4 vec(x,y,z,0.f);
- if (iter == mValue.end() || shouldChange(iter->second,vec))
- {
- glUniform3fARB(mUniform[index], x, y, z);
- mValue[mUniform[index]] = vec;
- }
- }
- }
+ if (mProgramObject > 0)
+ {
+ if (mUniform.size() <= index)
+ {
+ UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ return;
+ }
+
+ if (mUniform[index] >= 0)
+ {
+ std::map<GLint, LLVector4>::iterator iter = mValue.find(mUniform[index]);
+ LLVector4 vec(x,y,z,0.f);
+ if (iter == mValue.end() || shouldChange(iter->second,vec))
+ {
+ glUniform3fARB(mUniform[index], x, y, z);
+ mValue[mUniform[index]] = vec;
+ }
+ }
+ }
}
void LLGLSLShader::uniform4f(U32 index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
- if (mProgramObject > 0)
- {
- if (mUniform.size() <= index)
- {
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
- return;
- }
-
- if (mUniform[index] >= 0)
- {
- std::map<GLint, LLVector4>::iterator iter = mValue.find(mUniform[index]);
- LLVector4 vec(x,y,z,w);
- if (iter == mValue.end() || shouldChange(iter->second,vec))
- {
- glUniform4fARB(mUniform[index], x, y, z, w);
- mValue[mUniform[index]] = vec;
- }
- }
- }
+ if (mProgramObject > 0)
+ {
+ if (mUniform.size() <= index)
+ {
+ UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ return;
+ }
+
+ if (mUniform[index] >= 0)
+ {
+ std::map<GLint, LLVector4>::iterator iter = mValue.find(mUniform[index]);
+ LLVector4 vec(x,y,z,w);
+ if (iter == mValue.end() || shouldChange(iter->second,vec))
+ {
+ glUniform4fARB(mUniform[index], x, y, z, w);
+ mValue[mUniform[index]] = vec;
+ }
+ }
+ }
}
void LLGLSLShader::uniform1iv(U32 index, U32 count, const GLint* v)
{
- if (mProgramObject > 0)
- {
- if (mUniform.size() <= index)
- {
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
- return;
- }
-
- if (mUniform[index] >= 0)
- {
- std::map<GLint, LLVector4>::iterator iter = mValue.find(mUniform[index]);
- LLVector4 vec(v[0],0.f,0.f,0.f);
- if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1)
- {
- glUniform1ivARB(mUniform[index], count, v);
- mValue[mUniform[index]] = vec;
- }
- }
- }
+ if (mProgramObject > 0)
+ {
+ if (mUniform.size() <= index)
+ {
+ UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ return;
+ }
+
+ if (mUniform[index] >= 0)
+ {
+ std::map<GLint, LLVector4>::iterator iter = mValue.find(mUniform[index]);
+ LLVector4 vec(v[0],0.f,0.f,0.f);
+ if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1)
+ {
+ glUniform1ivARB(mUniform[index], count, v);
+ mValue[mUniform[index]] = vec;
+ }
+ }
+ }
}
void LLGLSLShader::uniform1fv(U32 index, U32 count, const GLfloat* v)
{
- if (mProgramObject > 0)
- {
- if (mUniform.size() <= index)
- {
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
- return;
- }
-
- if (mUniform[index] >= 0)
- {
- std::map<GLint, LLVector4>::iterator iter = mValue.find(mUniform[index]);
- LLVector4 vec(v[0],0.f,0.f,0.f);
- if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1)
- {
- glUniform1fvARB(mUniform[index], count, v);
- mValue[mUniform[index]] = vec;
- }
- }
- }
+ if (mProgramObject > 0)
+ {
+ if (mUniform.size() <= index)
+ {
+ UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ return;
+ }
+
+ if (mUniform[index] >= 0)
+ {
+ std::map<GLint, LLVector4>::iterator iter = mValue.find(mUniform[index]);
+ LLVector4 vec(v[0],0.f,0.f,0.f);
+ if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1)
+ {
+ glUniform1fvARB(mUniform[index], count, v);
+ mValue[mUniform[index]] = vec;
+ }
+ }
+ }
}
void LLGLSLShader::uniform2fv(U32 index, U32 count, const GLfloat* v)
{
- if (mProgramObject > 0)
- {
- if (mUniform.size() <= index)
- {
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
- return;
- }
-
- if (mUniform[index] >= 0)
- {
- std::map<GLint, LLVector4>::iterator iter = mValue.find(mUniform[index]);
- LLVector4 vec(v[0],v[1],0.f,0.f);
- if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1)
- {
- glUniform2fvARB(mUniform[index], count, v);
- mValue[mUniform[index]] = vec;
- }
- }
- }
+ if (mProgramObject > 0)
+ {
+ if (mUniform.size() <= index)
+ {
+ UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ return;
+ }
+
+ if (mUniform[index] >= 0)
+ {
+ std::map<GLint, LLVector4>::iterator iter = mValue.find(mUniform[index]);
+ LLVector4 vec(v[0],v[1],0.f,0.f);
+ if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1)
+ {
+ glUniform2fvARB(mUniform[index], count, v);
+ mValue[mUniform[index]] = vec;
+ }
+ }
+ }
}
void LLGLSLShader::uniform3fv(U32 index, U32 count, const GLfloat* v)
{
- if (mProgramObject > 0)
- {
- if (mUniform.size() <= index)
- {
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
- return;
- }
-
- if (mUniform[index] >= 0)
- {
- std::map<GLint, LLVector4>::iterator iter = mValue.find(mUniform[index]);
- LLVector4 vec(v[0],v[1],v[2],0.f);
- if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1)
- {
- glUniform3fvARB(mUniform[index], count, v);
- mValue[mUniform[index]] = vec;
- }
- }
- }
+ if (mProgramObject > 0)
+ {
+ if (mUniform.size() <= index)
+ {
+ UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ return;
+ }
+
+ if (mUniform[index] >= 0)
+ {
+ std::map<GLint, LLVector4>::iterator iter = mValue.find(mUniform[index]);
+ LLVector4 vec(v[0],v[1],v[2],0.f);
+ if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1)
+ {
+ glUniform3fvARB(mUniform[index], count, v);
+ mValue[mUniform[index]] = vec;
+ }
+ }
+ }
}
void LLGLSLShader::uniform4fv(U32 index, U32 count, const GLfloat* v)
{
- if (mProgramObject > 0)
- {
- if (mUniform.size() <= index)
- {
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
- return;
- }
-
- if (mUniform[index] >= 0)
- {
- std::map<GLint, LLVector4>::iterator iter = mValue.find(mUniform[index]);
- LLVector4 vec(v[0],v[1],v[2],v[3]);
- if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1)
- {
- glUniform4fvARB(mUniform[index], count, v);
- mValue[mUniform[index]] = vec;
- }
- }
- }
+ if (mProgramObject > 0)
+ {
+ if (mUniform.size() <= index)
+ {
+ UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ return;
+ }
+
+ if (mUniform[index] >= 0)
+ {
+ std::map<GLint, LLVector4>::iterator iter = mValue.find(mUniform[index]);
+ LLVector4 vec(v[0],v[1],v[2],v[3]);
+ if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1)
+ {
+ glUniform4fvARB(mUniform[index], count, v);
+ mValue[mUniform[index]] = vec;
+ }
+ }
+ }
}
void LLGLSLShader::uniformMatrix2fv(U32 index, U32 count, GLboolean transpose, const GLfloat *v)
{
- if (mProgramObject > 0)
- {
- if (mUniform.size() <= index)
- {
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
- return;
- }
-
- if (mUniform[index] >= 0)
- {
- glUniformMatrix2fvARB(mUniform[index], count, transpose, v);
- }
- }
+ if (mProgramObject > 0)
+ {
+ if (mUniform.size() <= index)
+ {
+ UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ return;
+ }
+
+ if (mUniform[index] >= 0)
+ {
+ glUniformMatrix2fvARB(mUniform[index], count, transpose, v);
+ }
+ }
}
void LLGLSLShader::uniformMatrix3fv(U32 index, U32 count, GLboolean transpose, const GLfloat *v)
{
- if (mProgramObject > 0)
- {
- if (mUniform.size() <= index)
- {
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
- return;
- }
-
- if (mUniform[index] >= 0)
- {
- glUniformMatrix3fvARB(mUniform[index], count, transpose, v);
- }
- }
+ if (mProgramObject > 0)
+ {
+ if (mUniform.size() <= index)
+ {
+ UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ return;
+ }
+
+ if (mUniform[index] >= 0)
+ {
+ glUniformMatrix3fvARB(mUniform[index], count, transpose, v);
+ }
+ }
}
void LLGLSLShader::uniformMatrix4fv(U32 index, U32 count, GLboolean transpose, const GLfloat *v)
{
- if (mProgramObject > 0)
- {
- if (mUniform.size() <= index)
- {
- UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
- return;
- }
-
- if (mUniform[index] >= 0)
- {
- glUniformMatrix4fvARB(mUniform[index], count, transpose, v);
- }
- }
+ if (mProgramObject > 0)
+ {
+ if (mUniform.size() <= index)
+ {
+ UNIFORM_ERRS << "Uniform index out of bounds." << LL_ENDL;
+ return;
+ }
+
+ if (mUniform[index] >= 0)
+ {
+ glUniformMatrix4fvARB(mUniform[index], count, transpose, v);
+ }
+ }
}
GLint LLGLSLShader::getUniformLocation(const LLStaticHashedString& uniform)
{
- GLint ret = -1;
- if (mProgramObject > 0)
- {
- LLStaticStringTable<GLint>::iterator iter = mUniformMap.find(uniform);
- if (iter != mUniformMap.end())
- {
- if (gDebugGL)
- {
- stop_glerror();
- if (iter->second != glGetUniformLocationARB(mProgramObject, uniform.String().c_str()))
- {
- LL_ERRS() << "Uniform does not match." << LL_ENDL;
- }
- stop_glerror();
- }
- ret = iter->second;
- }
- }
-
- return ret;
+ GLint ret = -1;
+ if (mProgramObject > 0)
+ {
+ LLStaticStringTable<GLint>::iterator iter = mUniformMap.find(uniform);
+ if (iter != mUniformMap.end())
+ {
+ if (gDebugGL)
+ {
+ stop_glerror();
+ if (iter->second != glGetUniformLocationARB(mProgramObject, uniform.String().c_str()))
+ {
+ LL_ERRS() << "Uniform does not match." << LL_ENDL;
+ }
+ stop_glerror();
+ }
+ ret = iter->second;
+ }
+ }
+
+ return ret;
}
GLint LLGLSLShader::getUniformLocation(U32 index)
{
- GLint ret = -1;
- if (mProgramObject > 0)
- {
- llassert(index < mUniform.size());
- return mUniform[index];
- }
-
- return ret;
+ GLint ret = -1;
+ if (mProgramObject > 0)
+ {
+ llassert(index < mUniform.size());
+ return mUniform[index];
+ }
+
+ return ret;
}
GLint LLGLSLShader::getAttribLocation(U32 attrib)
{
- if (attrib < mAttribute.size())
- {
- return mAttribute[attrib];
- }
- else
- {
- return -1;
- }
+ if (attrib < mAttribute.size())
+ {
+ return mAttribute[attrib];
+ }
+ else
+ {
+ return -1;
+ }
}
void LLGLSLShader::uniform1i(const LLStaticHashedString& uniform, GLint v)
{
- GLint location = getUniformLocation(uniform);
-
- if (location >= 0)
- {
- std::map<GLint, LLVector4>::iterator iter = mValue.find(location);
- LLVector4 vec(v,0.f,0.f,0.f);
- if (iter == mValue.end() || shouldChange(iter->second,vec))
- {
- glUniform1iARB(location, v);
- mValue[location] = vec;
- }
- }
+ GLint location = getUniformLocation(uniform);
+
+ if (location >= 0)
+ {
+ std::map<GLint, LLVector4>::iterator iter = mValue.find(location);
+ LLVector4 vec(v,0.f,0.f,0.f);
+ if (iter == mValue.end() || shouldChange(iter->second,vec))
+ {
+ glUniform1iARB(location, v);
+ mValue[location] = vec;
+ }
+ }
}
void LLGLSLShader::uniform2i(const LLStaticHashedString& uniform, GLint i, GLint j)
{
- GLint location = getUniformLocation(uniform);
-
- if (location >= 0)
- {
- std::map<GLint, LLVector4>::iterator iter = mValue.find(location);
- LLVector4 vec(i,j,0.f,0.f);
- if (iter == mValue.end() || shouldChange(iter->second,vec))
- {
- glUniform2iARB(location, i, j);
- mValue[location] = vec;
- }
- }
+ GLint location = getUniformLocation(uniform);
+
+ if (location >= 0)
+ {
+ std::map<GLint, LLVector4>::iterator iter = mValue.find(location);
+ LLVector4 vec(i,j,0.f,0.f);
+ if (iter == mValue.end() || shouldChange(iter->second,vec))
+ {
+ glUniform2iARB(location, i, j);
+ mValue[location] = vec;
+ }
+ }
}
void LLGLSLShader::uniform1f(const LLStaticHashedString& uniform, GLfloat v)
{
- GLint location = getUniformLocation(uniform);
-
- if (location >= 0)
- {
- std::map<GLint, LLVector4>::iterator iter = mValue.find(location);
- LLVector4 vec(v,0.f,0.f,0.f);
- if (iter == mValue.end() || shouldChange(iter->second,vec))
- {
- glUniform1fARB(location, v);
- mValue[location] = vec;
- }
- }
+ GLint location = getUniformLocation(uniform);
+
+ if (location >= 0)
+ {
+ std::map<GLint, LLVector4>::iterator iter = mValue.find(location);
+ LLVector4 vec(v,0.f,0.f,0.f);
+ if (iter == mValue.end() || shouldChange(iter->second,vec))
+ {
+ glUniform1fARB(location, v);
+ mValue[location] = vec;
+ }
+ }
}
void LLGLSLShader::uniform2f(const LLStaticHashedString& uniform, GLfloat x, GLfloat y)
{
- GLint location = getUniformLocation(uniform);
-
- if (location >= 0)
- {
- std::map<GLint, LLVector4>::iterator iter = mValue.find(location);
- LLVector4 vec(x,y,0.f,0.f);
- if (iter == mValue.end() || shouldChange(iter->second,vec))
- {
- glUniform2fARB(location, x,y);
- mValue[location] = vec;
- }
- }
+ GLint location = getUniformLocation(uniform);
+
+ if (location >= 0)
+ {
+ std::map<GLint, LLVector4>::iterator iter = mValue.find(location);
+ LLVector4 vec(x,y,0.f,0.f);
+ if (iter == mValue.end() || shouldChange(iter->second,vec))
+ {
+ glUniform2fARB(location, x,y);
+ mValue[location] = vec;
+ }
+ }
}
void LLGLSLShader::uniform3f(const LLStaticHashedString& uniform, GLfloat x, GLfloat y, GLfloat z)
{
- GLint location = getUniformLocation(uniform);
-
- if (location >= 0)
- {
- std::map<GLint, LLVector4>::iterator iter = mValue.find(location);
- LLVector4 vec(x,y,z,0.f);
- if (iter == mValue.end() || shouldChange(iter->second,vec))
- {
- glUniform3fARB(location, x,y,z);
- mValue[location] = vec;
- }
- }
+ GLint location = getUniformLocation(uniform);
+
+ if (location >= 0)
+ {
+ std::map<GLint, LLVector4>::iterator iter = mValue.find(location);
+ LLVector4 vec(x,y,z,0.f);
+ if (iter == mValue.end() || shouldChange(iter->second,vec))
+ {
+ glUniform3fARB(location, x,y,z);
+ mValue[location] = vec;
+ }
+ }
}
void LLGLSLShader::uniform1fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v)
{
- GLint location = getUniformLocation(uniform);
-
- if (location >= 0)
- {
- std::map<GLint, LLVector4>::iterator iter = mValue.find(location);
- LLVector4 vec(v[0],0.f,0.f,0.f);
- if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1)
- {
- glUniform1fvARB(location, count, v);
- mValue[location] = vec;
- }
- }
+ GLint location = getUniformLocation(uniform);
+
+ if (location >= 0)
+ {
+ std::map<GLint, LLVector4>::iterator iter = mValue.find(location);
+ LLVector4 vec(v[0],0.f,0.f,0.f);
+ if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1)
+ {
+ glUniform1fvARB(location, count, v);
+ mValue[location] = vec;
+ }
+ }
}
void LLGLSLShader::uniform2fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v)
{
- GLint location = getUniformLocation(uniform);
-
- if (location >= 0)
- {
- std::map<GLint, LLVector4>::iterator iter = mValue.find(location);
- LLVector4 vec(v[0],v[1],0.f,0.f);
- if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1)
- {
- glUniform2fvARB(location, count, v);
- mValue[location] = vec;
- }
- }
+ GLint location = getUniformLocation(uniform);
+
+ if (location >= 0)
+ {
+ std::map<GLint, LLVector4>::iterator iter = mValue.find(location);
+ LLVector4 vec(v[0],v[1],0.f,0.f);
+ if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1)
+ {
+ glUniform2fvARB(location, count, v);
+ mValue[location] = vec;
+ }
+ }
}
void LLGLSLShader::uniform3fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v)
{
- GLint location = getUniformLocation(uniform);
-
- if (location >= 0)
- {
- std::map<GLint, LLVector4>::iterator iter = mValue.find(location);
- LLVector4 vec(v[0],v[1],v[2],0.f);
- if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1)
- {
- glUniform3fvARB(location, count, v);
- mValue[location] = vec;
- }
- }
+ GLint location = getUniformLocation(uniform);
+
+ if (location >= 0)
+ {
+ std::map<GLint, LLVector4>::iterator iter = mValue.find(location);
+ LLVector4 vec(v[0],v[1],v[2],0.f);
+ if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1)
+ {
+ glUniform3fvARB(location, count, v);
+ mValue[location] = vec;
+ }
+ }
}
void LLGLSLShader::uniform4fv(const LLStaticHashedString& uniform, U32 count, const GLfloat* v)
{
- GLint location = getUniformLocation(uniform);
-
- if (location >= 0)
- {
- LLVector4 vec(v);
- std::map<GLint, LLVector4>::iterator iter = mValue.find(location);
- if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1)
- {
- stop_glerror();
- glUniform4fvARB(location, count, v);
- stop_glerror();
- mValue[location] = vec;
- }
- }
+ GLint location = getUniformLocation(uniform);
+
+ if (location >= 0)
+ {
+ LLVector4 vec(v);
+ std::map<GLint, LLVector4>::iterator iter = mValue.find(location);
+ if (iter == mValue.end() || shouldChange(iter->second,vec) || count != 1)
+ {
+ stop_glerror();
+ glUniform4fvARB(location, count, v);
+ stop_glerror();
+ mValue[location] = vec;
+ }
+ }
}
void LLGLSLShader::uniformMatrix4fv(const LLStaticHashedString& uniform, U32 count, GLboolean transpose, const GLfloat* v)
{
- GLint location = getUniformLocation(uniform);
-
- if (location >= 0)
- {
- stop_glerror();
- glUniformMatrix4fvARB(location, count, transpose, v);
- stop_glerror();
- }
+ GLint location = getUniformLocation(uniform);
+
+ if (location >= 0)
+ {
+ stop_glerror();
+ glUniformMatrix4fvARB(location, count, transpose, v);
+ stop_glerror();
+ }
}
void LLGLSLShader::vertexAttrib4f(U32 index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
- if (mAttribute[index] > 0)
- {
- glVertexAttrib4fARB(mAttribute[index], x, y, z, w);
- }
+ if (mAttribute[index] > 0)
+ {
+ glVertexAttrib4fARB(mAttribute[index], x, y, z, w);
+ }
}
void LLGLSLShader::vertexAttrib4fv(U32 index, GLfloat* v)
{
- if (mAttribute[index] > 0)
- {
- glVertexAttrib4fvARB(mAttribute[index], v);
- }
+ if (mAttribute[index] > 0)
+ {
+ glVertexAttrib4fvARB(mAttribute[index], v);
+ }
}
void LLGLSLShader::setMinimumAlpha(F32 minimum)
{
- gGL.flush();
- uniform1f(LLShaderMgr::MINIMUM_ALPHA, minimum);
+ gGL.flush();
+ uniform1f(LLShaderMgr::MINIMUM_ALPHA, minimum);
}
diff --git a/indra/llrender/llpostprocess.cpp b/indra/llrender/llpostprocess.cpp
index a95bb7027b..b6ea5aa7f1 100755
--- a/indra/llrender/llpostprocess.cpp
+++ b/indra/llrender/llpostprocess.cpp
@@ -49,17 +49,8 @@ static LLStaticHashedString sBlurWidth("blurWidth");
LLPostProcess * gPostProcess = NULL;
-
static const unsigned int NOISE_SIZE = 512;
-/// CALCULATING LUMINANCE (Using NTSC lum weights)
-/// http://en.wikipedia.org/wiki/Luma_%28video%29
-static const float LUMINANCE_R = 0.299f;
-static const float LUMINANCE_G = 0.587f;
-static const float LUMINANCE_B = 0.114f;
-
-static const char * const XML_FILENAME = "postprocesseffects.xml";
-
LLPostProcess::LLPostProcess(void) :
initialized(false),
mAllEffects(LLSD::emptyMap()),
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 388d3a4f1a..0af402efea 100755
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1168,7 +1168,7 @@ void LLRender::syncMatrices()
{
stop_glerror();
- U32 name[] =
+ static const U32 name[] =
{
LLShaderMgr::MODELVIEW_MATRIX,
LLShaderMgr::PROJECTION_MATRIX,
diff --git a/indra/llrender/llrender2dutils.cpp b/indra/llrender/llrender2dutils.cpp
index df5d79a436..4e2ebfd51e 100644
--- a/indra/llrender/llrender2dutils.cpp
+++ b/indra/llrender/llrender2dutils.cpp
@@ -433,8 +433,8 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex
F32 image_width = image->getWidth(0);
F32 image_height = image->getHeight(0);
- S32 image_natural_width = llround(image_width * uv_width);
- S32 image_natural_height = llround(image_height * uv_height);
+ S32 image_natural_width = ll_round(image_width * uv_width);
+ S32 image_natural_height = ll_round(image_height * uv_height);
LLRectf draw_center_rect( uv_center_rect.mLeft * image_width,
uv_center_rect.mTop * image_height,
@@ -468,10 +468,10 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex
draw_center_rect.setCenterAndSize(uv_center_rect.getCenterX() * width, uv_center_rect.getCenterY() * height, scaled_width, scaled_height);
}
- 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]);
+ draw_center_rect.mLeft = ll_round(ui_translation.mV[VX] + (F32)draw_center_rect.mLeft * ui_scale.mV[VX]);
+ draw_center_rect.mTop = ll_round(ui_translation.mV[VY] + (F32)draw_center_rect.mTop * ui_scale.mV[VY]);
+ draw_center_rect.mRight = ll_round(ui_translation.mV[VX] + (F32)draw_center_rect.mRight * ui_scale.mV[VX]);
+ draw_center_rect.mBottom = ll_round(ui_translation.mV[VY] + (F32)draw_center_rect.mBottom * ui_scale.mV[VY]);
LLRectf draw_outer_rect(ui_translation.mV[VX],
ui_translation.mV[VY] + height * ui_scale.mV[VY],
@@ -703,8 +703,8 @@ void gl_draw_scaled_rotated_image(S32 x, S32 y, S32 width, S32 height, F32 degre
ui_translation.mV[VY] += y;
ui_translation.scaleVec(ui_scale);
S32 index = 0;
- S32 scaled_width = llround(width * ui_scale.mV[VX]);
- S32 scaled_height = llround(height * ui_scale.mV[VY]);
+ S32 scaled_width = ll_round(width * ui_scale.mV[VX]);
+ S32 scaled_height = ll_round(height * ui_scale.mV[VY]);
uv[index] = LLVector2(uv_rect.mRight, uv_rect.mTop);
pos[index] = LLVector3(ui_translation.mV[VX] + scaled_width, ui_translation.mV[VY] + scaled_height, 0.f);
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index a89ec675b4..b2be3cc3b6 100755
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -674,12 +674,17 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
if (defines)
{
for (boost::unordered_map<std::string,std::string>::iterator iter = defines->begin(); iter != defines->end(); ++iter)
- {
- std::string define = "#define " + iter->first + " " + iter->second + "\n";
- text[count++] = (GLcharARB *) strdup(define.c_str());
- }
+ {
+ std::string define = "#define " + iter->first + " " + iter->second + "\n";
+ text[count++] = (GLcharARB *) strdup(define.c_str());
+ }
}
+ if( gGLManager.mIsATI )
+ {
+ text[ count++ ] = strdup( "#define IS_AMD_CARD 1\n" );
+ }
+
if (texture_index_channels > 0 && type == GL_FRAGMENT_SHADER_ARB)
{
//use specified number of texture channels for indexed texture rendering
diff --git a/indra/llrender/lluiimage.cpp b/indra/llrender/lluiimage.cpp
index 6f1fae92cd..5d8f92b2e6 100644
--- a/indra/llrender/lluiimage.cpp
+++ b/indra/llrender/lluiimage.cpp
@@ -149,13 +149,13 @@ void LLUIImage::draw3D(const LLVector3& origin_agent, const LLVector3& x_axis, c
S32 LLUIImage::getWidth() const
{
// return clipped dimensions of actual image area
- return llround((F32)mImage->getWidth(0) * mClipRegion.getWidth());
+ return ll_round((F32)mImage->getWidth(0) * mClipRegion.getWidth());
}
S32 LLUIImage::getHeight() const
{
// return clipped dimensions of actual image area
- return llround((F32)mImage->getHeight(0) * mClipRegion.getHeight());
+ return ll_round((F32)mImage->getHeight(0) * mClipRegion.getHeight());
}
S32 LLUIImage::getTextureWidth() const
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index d06564df36..0fae600a90 100755
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -843,9 +843,11 @@ void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const
{
LL_RECORD_BLOCK_TIME(FTM_GL_DRAW_ARRAYS);
stop_glerror();
- LLGLSLShader::startProfile();
+ LLGLSLShader::startProfile();
+ stop_glerror();
glDrawArrays(sGLMode[mode], first, count);
- LLGLSLShader::stopProfile(count, mode);
+ stop_glerror();
+ LLGLSLShader::stopProfile(count, mode);
}
stop_glerror();
diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp
index b787794b95..623f570cef 100755
--- a/indra/llui/llaccordionctrl.cpp
+++ b/indra/llui/llaccordionctrl.cpp
@@ -36,25 +36,17 @@
#include "boost/bind.hpp"
-static const S32 DRAGGER_BAR_MARGIN = 4;
-static const S32 DRAGGER_BAR_HEIGHT = 5;
static const S32 BORDER_MARGIN = 2;
static const S32 PARENT_BORDER_MARGIN = 5;
-
-static const S32 panel_delta = DRAGGER_BAR_MARGIN; // Distanse between two panels
-
-static const S32 HORIZONTAL_MULTIPLE = 8;
static const S32 VERTICAL_MULTIPLE = 16;
static const F32 MIN_AUTO_SCROLL_RATE = 120.f;
static const F32 MAX_AUTO_SCROLL_RATE = 500.f;
static const F32 AUTO_SCROLL_RATE_ACCEL = 120.f;
-
// LLAccordionCtrl =================================================================|
static LLDefaultChildRegistry::Register<LLAccordionCtrl> t2("accordion");
-
LLAccordionCtrl::LLAccordionCtrl(const Params& params):LLPanel(params)
, mFitParent(params.fit_parent)
, mAutoScrolling( false )
@@ -613,7 +605,7 @@ BOOL LLAccordionCtrl::autoScroll (S32 x, S32 y)
// autoscroll region should take up no more than one third of visible scroller area
S32 auto_scroll_region_height = llmin(rect_local.getHeight() / 3, 10);
- S32 auto_scroll_speed = llround(mAutoScrollRate * LLFrameTimer::getFrameDeltaTimeF32());
+ S32 auto_scroll_speed = ll_round(mAutoScrollRate * LLFrameTimer::getFrameDeltaTimeF32());
LLRect bottom_scroll_rect = screen_local_extents;
bottom_scroll_rect.mTop = rect_local.mBottom + auto_scroll_region_height;
diff --git a/indra/llui/llbadge.cpp b/indra/llui/llbadge.cpp
index 30cb18812b..42726de0ad 100755
--- a/indra/llui/llbadge.cpp
+++ b/indra/llui/llbadge.cpp
@@ -196,10 +196,10 @@ void renderBadgeBackground(F32 centerX, F32 centerY, F32 width, F32 height, cons
F32 x = LLFontGL::sCurOrigin.mX + centerX - width * 0.5f;
F32 y = LLFontGL::sCurOrigin.mY + centerY - height * 0.5f;
- LLRectf screen_rect(llround(x),
- llround(y),
- llround(x) + width,
- llround(y) + height);
+ LLRectf screen_rect(ll_round(x),
+ ll_round(y),
+ ll_round(x) + width,
+ ll_round(y) + height);
LLVector3 vertices[4];
vertices[0] = LLVector3(screen_rect.mRight, screen_rect.mTop, 1.0f);
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index ce8383857c..8c7df45884 100755
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -606,8 +606,8 @@ void LLButton::getOverlayImageSize(S32& overlay_width, S32& overlay_height)
overlay_height = mImageOverlay->getHeight();
F32 scale_factor = llmin((F32)getRect().getWidth() / (F32)overlay_width, (F32)getRect().getHeight() / (F32)overlay_height, 1.f);
- overlay_width = llround((F32)overlay_width * scale_factor);
- overlay_height = llround((F32)overlay_height * scale_factor);
+ overlay_width = ll_round((F32)overlay_width * scale_factor);
+ overlay_height = ll_round((F32)overlay_height * scale_factor);
}
@@ -776,7 +776,7 @@ void LLButton::draw()
if (hasFocus())
{
F32 lerp_amt = gFocusMgr.getFocusFlashAmt();
- drawBorder(imagep, gFocusMgr.getFocusColor() % alpha, llround(lerp(1.f, 3.f, lerp_amt)));
+ drawBorder(imagep, gFocusMgr.getFocusColor() % alpha, ll_round(lerp(1.f, 3.f, lerp_amt)));
}
if (use_glow_effect)
@@ -1067,7 +1067,7 @@ void LLButton::resize(LLUIString label)
{
S32 overlay_width = mImageOverlay->getWidth();
F32 scale_factor = (getRect().getHeight() - (mImageOverlayBottomPad + mImageOverlayTopPad)) / (F32)mImageOverlay->getHeight();
- overlay_width = llround((F32)overlay_width * scale_factor);
+ overlay_width = ll_round((F32)overlay_width * scale_factor);
switch(mImageOverlayAlignment)
{
diff --git a/indra/llui/llcheckboxctrl.cpp b/indra/llui/llcheckboxctrl.cpp
index 5525520d78..eee6339caf 100755
--- a/indra/llui/llcheckboxctrl.cpp
+++ b/indra/llui/llcheckboxctrl.cpp
@@ -41,8 +41,6 @@
#include "lltextbox.h"
#include "llkeyboard.h"
-const U32 MAX_STRING_LENGTH = 10;
-
static LLDefaultChildRegistry::Register<LLCheckBoxCtrl> r("check_box");
// Compiler optimization, generate extern template
diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp
index fdfaf284de..26ae31cac6 100755
--- a/indra/llui/llconsole.cpp
+++ b/indra/llui/llconsole.cpp
@@ -52,7 +52,6 @@ extern void AddNewDebugConsoleToLCD(const LLWString &newLine);
LLConsole* gConsole = NULL; // Created and destroyed in LLViewerWindow.
const F32 FADE_DURATION = 2.f;
-const S32 MIN_CONSOLE_WIDTH = 200;
static LLDefaultChildRegistry::Register<LLConsole> r("console");
diff --git a/indra/llui/lldraghandle.cpp b/indra/llui/lldraghandle.cpp
index 7c6559eddb..48bf5bb80f 100755
--- a/indra/llui/lldraghandle.cpp
+++ b/indra/llui/lldraghandle.cpp
@@ -46,7 +46,6 @@ const S32 LEADING_PAD = 5;
const S32 TITLE_HPAD = 8;
const S32 BORDER_PAD = 1;
const S32 LEFT_PAD = BORDER_PAD + TITLE_HPAD + LEADING_PAD;
-const S32 RIGHT_PAD = BORDER_PAD + 32; // HACK: space for close btn and minimize btn
S32 LLDragHandle::sSnapMargin = 5;
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 3dbc9a5902..14f75a2352 100755
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -1954,7 +1954,7 @@ void LLFloater::drawShadow(LLPanel* panel)
}
gl_drop_shadow(left, top, right, bottom,
shadow_color % getCurrentTransparency(),
- llround(shadow_offset));
+ ll_round(shadow_offset));
}
void LLFloater::updateTransparency(LLView* view, ETypeTransparency transparency_type)
@@ -2082,16 +2082,16 @@ void LLFloater::updateTitleButtons()
btn_rect.setLeftTopAndSize(
LLPANEL_BORDER_WIDTH,
getRect().getHeight() - close_box_from_top - (floater_close_box_size + 1) * button_count,
- llround((F32)floater_close_box_size * mButtonScale),
- llround((F32)floater_close_box_size * mButtonScale));
+ ll_round((F32)floater_close_box_size * mButtonScale),
+ ll_round((F32)floater_close_box_size * mButtonScale));
}
else
{
btn_rect.setLeftTopAndSize(
getRect().getWidth() - LLPANEL_BORDER_WIDTH - (floater_close_box_size + 1) * button_count,
getRect().getHeight() - close_box_from_top,
- llround((F32)floater_close_box_size * mButtonScale),
- llround((F32)floater_close_box_size * mButtonScale));
+ ll_round((F32)floater_close_box_size * mButtonScale),
+ ll_round((F32)floater_close_box_size * mButtonScale));
}
// first time here, init 'buttons_rect'
@@ -2142,16 +2142,16 @@ void LLFloater::buildButtons(const Params& floater_params)
btn_rect.setLeftTopAndSize(
LLPANEL_BORDER_WIDTH,
getRect().getHeight() - close_box_from_top - (floater_close_box_size + 1) * (i + 1),
- llround(floater_close_box_size * mButtonScale),
- llround(floater_close_box_size * mButtonScale));
+ ll_round(floater_close_box_size * mButtonScale),
+ ll_round(floater_close_box_size * mButtonScale));
}
else
{
btn_rect.setLeftTopAndSize(
getRect().getWidth() - LLPANEL_BORDER_WIDTH - (floater_close_box_size + 1) * (i + 1),
getRect().getHeight() - close_box_from_top,
- llround(floater_close_box_size * mButtonScale),
- llround(floater_close_box_size * mButtonScale));
+ ll_round(floater_close_box_size * mButtonScale),
+ ll_round(floater_close_box_size * mButtonScale));
}
LLButton::Params p;
@@ -3466,28 +3466,28 @@ LLCoordCommon LL_COORD_FLOATER::convertToCommon() const
LLCoordCommon out;
if (self.mX < -0.5f)
{
- out.mX = llround(rescale(self.mX, -1.f, -0.5f, snap_rect.mLeft - (floater_width - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mLeft));
+ out.mX = ll_round(rescale(self.mX, -1.f, -0.5f, snap_rect.mLeft - (floater_width - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mLeft));
}
else if (self.mX > 0.5f)
{
- out.mX = llround(rescale(self.mX, 0.5f, 1.f, snap_rect.mRight - floater_width, snap_rect.mRight - FLOATER_MIN_VISIBLE_PIXELS));
+ out.mX = ll_round(rescale(self.mX, 0.5f, 1.f, snap_rect.mRight - floater_width, snap_rect.mRight - FLOATER_MIN_VISIBLE_PIXELS));
}
else
{
- out.mX = llround(rescale(self.mX, -0.5f, 0.5f, snap_rect.mLeft, snap_rect.mRight - floater_width));
+ out.mX = ll_round(rescale(self.mX, -0.5f, 0.5f, snap_rect.mLeft, snap_rect.mRight - floater_width));
}
if (self.mY < -0.5f)
{
- out.mY = llround(rescale(self.mY, -1.f, -0.5f, snap_rect.mBottom - (floater_height - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mBottom));
+ out.mY = ll_round(rescale(self.mY, -1.f, -0.5f, snap_rect.mBottom - (floater_height - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mBottom));
}
else if (self.mY > 0.5f)
{
- out.mY = llround(rescale(self.mY, 0.5f, 1.f, snap_rect.mTop - floater_height, snap_rect.mTop - FLOATER_MIN_VISIBLE_PIXELS));
+ out.mY = ll_round(rescale(self.mY, 0.5f, 1.f, snap_rect.mTop - floater_height, snap_rect.mTop - FLOATER_MIN_VISIBLE_PIXELS));
}
else
{
- out.mY = llround(rescale(self.mY, -0.5f, 0.5f, snap_rect.mBottom, snap_rect.mTop - floater_height));
+ out.mY = ll_round(rescale(self.mY, -0.5f, 0.5f, snap_rect.mBottom, snap_rect.mTop - floater_height));
}
// return center point instead of lower left
diff --git a/indra/llui/llfocusmgr.h b/indra/llui/llfocusmgr.h
index 1c7326260c..afd2a8ce06 100755
--- a/indra/llui/llfocusmgr.h
+++ b/indra/llui/llfocusmgr.h
@@ -92,7 +92,7 @@ public:
void setKeystrokesOnly(BOOL keystrokes_only) { mKeystrokesOnly = keystrokes_only; }
F32 getFocusFlashAmt() const;
- S32 getFocusFlashWidth() const { return llround(lerp(1.f, 3.f, getFocusFlashAmt())); }
+ S32 getFocusFlashWidth() const { return ll_round(lerp(1.f, 3.f, getFocusFlashAmt())); }
LLColor4 getFocusColor() const;
void triggerFocusFlash();
BOOL getAppHasFocus() const { return mAppHasFocus; }
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index 474b545f00..9f06ccc827 100755
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -53,7 +53,6 @@
/// Local function declarations, constants, enums, and typedefs
///----------------------------------------------------------------------------
-const S32 RENAME_WIDTH_PAD = 4;
const S32 RENAME_HEIGHT_PAD = 1;
const S32 AUTO_OPEN_STACK_DEPTH = 16;
@@ -307,18 +306,18 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height )
LLFolderViewFolder::arrange(&mMinWidth, &target_height);
LLRect scroll_rect = (mScrollContainer ? mScrollContainer->getContentWindowRect() : LLRect());
- reshape( llmax(scroll_rect.getWidth(), mMinWidth), llround(mCurHeight) );
+ reshape( llmax(scroll_rect.getWidth(), mMinWidth), ll_round(mCurHeight) );
LLRect new_scroll_rect = (mScrollContainer ? mScrollContainer->getContentWindowRect() : LLRect());
if (new_scroll_rect.getWidth() != scroll_rect.getWidth())
{
- reshape( llmax(scroll_rect.getWidth(), mMinWidth), llround(mCurHeight) );
+ reshape( llmax(scroll_rect.getWidth(), mMinWidth), ll_round(mCurHeight) );
}
// move item renamer text field to item's new position
updateRenamerPosition();
- return llround(mTargetHeight);
+ return ll_round(mTargetHeight);
}
static LLTrace::BlockTimerStatHandle FTM_FILTER("Filter Folder View");
@@ -341,7 +340,7 @@ void LLFolderView::reshape(S32 width, S32 height, BOOL called_from_parent)
scroll_rect = mScrollContainer->getContentWindowRect();
}
width = llmax(mMinWidth, scroll_rect.getWidth());
- height = llmax(llround(mCurHeight), scroll_rect.getHeight());
+ height = llmax(ll_round(mCurHeight), scroll_rect.getHeight());
// Restrict width within scroll container's width
if (mUseEllipses && mScrollContainer)
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index 7c88f8fb9b..747b472ac2 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -258,20 +258,19 @@ BOOL LLFolderViewItem::passedFilter(S32 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())
+ if (filter_generation < 0)
{
- return model->descendantsPassedFilter(filter_generation) || getVisible();
+ filter_generation = getFolderViewModel()->getFilter().getFirstSuccessGeneration();
}
- else
+ LLFolderViewModelItem* model = getViewModelItem();
+ BOOL visible = model->passedFilter(filter_generation);
+ if (model->getMarkedDirtyGeneration() >= filter_generation)
{
- return model->passedFilter(filter_generation);
+ // unsure visibility state
+ // retaining previous visibility until item is updated or filter generation changes
+ visible |= getVisible();
}
+ return visible;
}
void LLFolderViewItem::refresh()
@@ -862,7 +861,7 @@ void LLFolderViewItem::draw()
if (filter_string_length > 0)
{
- S32 left = llround(text_left) + font->getWidth(combined_string, 0, mViewModelItem->getFilterStringOffset()) - 2;
+ S32 left = ll_round(text_left) + font->getWidth(combined_string, 0, mViewModelItem->getFilterStringOffset()) - 2;
S32 right = left + font->getWidth(combined_string, mViewModelItem->getFilterStringOffset(), filter_string_length) + 2;
S32 bottom = llfloor(getRect().getHeight() - font->getLineHeight() - 3 - TOP_PAD);
S32 top = getRect().getHeight() - TOP_PAD;
@@ -1046,7 +1045,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
{
S32 child_width = *width;
S32 child_height = 0;
- S32 child_top = parent_item_height - llround(running_height);
+ S32 child_top = parent_item_height - ll_round(running_height);
target_height += folderp->arrange( &child_width, &child_height );
@@ -1065,7 +1064,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
{
S32 child_width = *width;
S32 child_height = 0;
- S32 child_top = parent_item_height - llround(running_height);
+ S32 child_top = parent_item_height - ll_round(running_height);
target_height += itemp->arrange( &child_width, &child_height );
// don't change width, as this item is as wide as its parent folder by construction
@@ -1102,7 +1101,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
folders_t::iterator fit = iter++;
// number of pixels that bottom of folder label is from top of parent folder
if (getRect().getHeight() - (*fit)->getRect().mTop + (*fit)->getItemHeight()
- > llround(mCurHeight) + mMaxFolderItemOverlap)
+ > ll_round(mCurHeight) + mMaxFolderItemOverlap)
{
// hide if beyond current folder height
(*fit)->setVisible(FALSE);
@@ -1115,7 +1114,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
items_t::iterator iit = iter++;
// number of pixels that bottom of item label is from top of parent folder
if (getRect().getHeight() - (*iit)->getRect().mBottom
- > llround(mCurHeight) + mMaxFolderItemOverlap)
+ > ll_round(mCurHeight) + mMaxFolderItemOverlap)
{
(*iit)->setVisible(FALSE);
}
@@ -1127,12 +1126,12 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height )
}
// don't change width as this item is already as wide as its parent folder
- reshape(getRect().getWidth(),llround(mCurHeight));
+ reshape(getRect().getWidth(),ll_round(mCurHeight));
// pass current height value back to parent
- *height = llround(mCurHeight);
+ *height = ll_round(mCurHeight);
- return llround(mTargetHeight);
+ return ll_round(mTargetHeight);
}
BOOL LLFolderViewFolder::needsArrange()
diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h
index 8d98363c5f..f6550eae42 100755
--- a/indra/llui/llfolderviewmodel.h
+++ b/indra/llui/llfolderviewmodel.h
@@ -185,11 +185,13 @@ public:
virtual void setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0) = 0;
virtual void setPassedFolderFilter(bool passed, S32 filter_generation) = 0;
virtual void dirtyFilter() = 0;
+ virtual void dirtyDescendantsFilter() = 0;
virtual bool hasFilterStringMatch() = 0;
virtual std::string::size_type getFilterStringOffset() = 0;
virtual std::string::size_type getFilterStringSize() = 0;
virtual S32 getLastFilterGeneration() const = 0;
+ virtual S32 getMarkedDirtyGeneration() const = 0;
virtual bool hasChildren() const = 0;
virtual void addChild(LLFolderViewModelItem* child) = 0;
@@ -230,6 +232,7 @@ public:
mFolderViewItem(NULL),
mLastFilterGeneration(-1),
mLastFolderFilterGeneration(-1),
+ mMarkedDirtyGeneration(-1),
mMostFilteredDescendantGeneration(-1),
mParent(NULL),
mRootViewModel(root_view_model)
@@ -243,8 +246,13 @@ public:
S32 getLastFilterGeneration() const { return mLastFilterGeneration; }
S32 getLastFolderFilterGeneration() const { return mLastFolderFilterGeneration; }
+ S32 getMarkedDirtyGeneration() const { return mMarkedDirtyGeneration; }
void dirtyFilter()
{
+ if(mMarkedDirtyGeneration < 0)
+ {
+ mMarkedDirtyGeneration = mLastFilterGeneration;
+ }
mLastFilterGeneration = -1;
mLastFolderFilterGeneration = -1;
@@ -254,6 +262,14 @@ public:
mParent->dirtyFilter();
}
}
+ void dirtyDescendantsFilter()
+ {
+ mMostFilteredDescendantGeneration = -1;
+ if (mParent)
+ {
+ mParent->dirtyDescendantsFilter();
+ }
+ }
bool hasFilterStringMatch();
std::string::size_type getFilterStringOffset();
std::string::size_type getFilterStringSize();
@@ -272,7 +288,7 @@ public:
return;
}
}
- mChildren.push_back(child);
+ mChildren.push_back(child);
child->setParent(this);
dirtyFilter();
requestSort();
@@ -280,7 +296,8 @@ public:
virtual void removeChild(LLFolderViewModelItem* child)
{
mChildren.remove(child);
- child->setParent(NULL);
+ child->setParent(NULL);
+ dirtyDescendantsFilter();
dirtyFilter();
}
@@ -290,6 +307,7 @@ public:
// This is different and not equivalent to calling removeChild() on each child
std::for_each(mChildren.begin(), mChildren.end(), DeletePointer());
mChildren.clear();
+ dirtyDescendantsFilter();
dirtyFilter();
}
@@ -303,6 +321,7 @@ public:
mLastFilterGeneration = filter_generation;
mStringMatchOffsetFilter = string_offset;
mStringFilterSize = string_size;
+ mMarkedDirtyGeneration = -1;
}
void setPassedFolderFilter(bool passed, S32 filter_generation)
@@ -351,7 +370,8 @@ protected:
S32 mLastFilterGeneration,
mLastFolderFilterGeneration,
- mMostFilteredDescendantGeneration;
+ mMostFilteredDescendantGeneration,
+ mMarkedDirtyGeneration;
child_list_t mChildren;
LLFolderViewModelItem* mParent;
diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp
index 75773d7dfd..6750ee482a 100755
--- a/indra/llui/llkeywords.cpp
+++ b/indra/llui/llkeywords.cpp
@@ -505,7 +505,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
}
// Skip white space
- while( *cur && isspace(*cur) && (*cur != '\n') )
+ while( *cur && iswspace(*cur) && (*cur != '\n') )
{
cur++;
}
@@ -548,7 +548,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
}
// Skip white space
- while( *cur && isspace(*cur) && (*cur != '\n') )
+ while( *cur && iswspace(*cur) && (*cur != '\n') )
{
cur++;
}
@@ -655,10 +655,10 @@ void LLKeywords::findSegments(std::vector<LLTextSegmentPtr>* seg_list, const LLW
// check against words
llwchar prev = cur > base ? *(cur-1) : 0;
- if( !isalnum( prev ) && (prev != '_') )
+ if( !iswalnum( prev ) && (prev != '_') )
{
const llwchar* p = cur;
- while( isalnum( *p ) || (*p == '_') )
+ while( iswalnum( *p ) || (*p == '_') )
{
p++;
}
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index c59286fc60..69246a2f57 100755
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -103,7 +103,7 @@ F32 LLLayoutPanel::getVisibleAmount() const
S32 LLLayoutPanel::getLayoutDim() const
{
- return llround((F32)((mOrientation == LLLayoutStack::HORIZONTAL)
+ return ll_round((F32)((mOrientation == LLLayoutStack::HORIZONTAL)
? getRect().getWidth()
: getRect().getHeight()));
}
@@ -130,7 +130,7 @@ void LLLayoutPanel::setTargetDim(S32 value)
S32 LLLayoutPanel::getVisibleDim() const
{
F32 min_dim = getRelevantMinDim();
- return llround(mVisibleAmt
+ return ll_round(mVisibleAmt
* (min_dim
+ (((F32)mTargetDim - min_dim) * (1.f - mCollapseAmt))));
}
@@ -138,7 +138,7 @@ S32 LLLayoutPanel::getVisibleDim() const
void LLLayoutPanel::setOrientation( LLView::EOrientation orientation )
{
mOrientation = orientation;
- S32 layout_dim = llround((F32)((mOrientation == LLLayoutStack::HORIZONTAL)
+ S32 layout_dim = ll_round((F32)((mOrientation == LLLayoutStack::HORIZONTAL)
? getRect().getWidth()
: getRect().getHeight()));
@@ -381,14 +381,14 @@ void LLLayoutStack::updateLayout()
{
panelp->mTargetDim = panelp->getRelevantMinDim();
}
- space_to_distribute -= panelp->getVisibleDim() + llround((F32)mPanelSpacing * panelp->getVisibleAmount());
+ space_to_distribute -= panelp->getVisibleDim() + ll_round((F32)mPanelSpacing * panelp->getVisibleAmount());
total_visible_fraction += panelp->mFractionalSize * panelp->getAutoResizeFactor();
}
llassert(total_visible_fraction < 1.05f);
// don't need spacing after last panel
- space_to_distribute += panelp ? llround((F32)mPanelSpacing * panelp->getVisibleAmount()) : 0;
+ space_to_distribute += panelp ? ll_round((F32)mPanelSpacing * panelp->getVisibleAmount()) : 0;
S32 remaining_space = space_to_distribute;
F32 fraction_distributed = 0.f;
@@ -399,7 +399,7 @@ void LLLayoutStack::updateLayout()
if (panelp->mAutoResize)
{
F32 fraction_to_distribute = (panelp->mFractionalSize * panelp->getAutoResizeFactor()) / (total_visible_fraction);
- S32 delta = llround((F32)space_to_distribute * fraction_to_distribute);
+ S32 delta = ll_round((F32)space_to_distribute * fraction_to_distribute);
fraction_distributed += fraction_to_distribute;
panelp->mTargetDim += delta;
remaining_space -= delta;
@@ -431,23 +431,23 @@ void LLLayoutStack::updateLayout()
LLRect panel_rect;
if (mOrientation == HORIZONTAL)
{
- panel_rect.setLeftTopAndSize(llround(cur_pos),
+ panel_rect.setLeftTopAndSize(ll_round(cur_pos),
getRect().getHeight(),
- llround(panel_dim),
+ ll_round(panel_dim),
getRect().getHeight());
}
else
{
panel_rect.setLeftTopAndSize(0,
- llround(cur_pos),
+ ll_round(cur_pos),
getRect().getWidth(),
- llround(panel_dim));
+ ll_round(panel_dim));
}
LLRect resize_bar_rect(panel_rect);
F32 panel_spacing = (F32)mPanelSpacing * panelp->getVisibleAmount();
F32 panel_visible_dim = panelp->getVisibleDim();
- S32 panel_spacing_round = (S32)(llround(panel_spacing));
+ S32 panel_spacing_round = (S32)(ll_round(panel_spacing));
if (mOrientation == HORIZONTAL)
{
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index 45f4272aa7..ae94a021d1 100755
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -829,7 +829,7 @@ BOOL LLLineEditor::handleHover(S32 x, S32 y, MASK mask)
// Scroll if mouse cursor outside of bounds
if (mScrollTimer.hasExpired())
{
- S32 increment = llround(mScrollTimer.getElapsedTimeF32() / AUTO_SCROLL_TIME);
+ S32 increment = ll_round(mScrollTimer.getElapsedTimeF32() / AUTO_SCROLL_TIME);
mScrollTimer.reset();
mScrollTimer.setTimerExpirySec(AUTO_SCROLL_TIME);
if( (x < mTextLeftEdge) && (mScrollHPos > 0 ) )
@@ -1833,7 +1833,7 @@ void LLLineEditor::draw()
0,
LLFontGL::NO_SHADOW,
select_left - mScrollHPos,
- mTextRightEdge - llround(rendered_pixels_right),
+ mTextRightEdge - ll_round(rendered_pixels_right),
&rendered_pixels_right);
}
@@ -1843,8 +1843,8 @@ void LLLineEditor::draw()
color.setAlpha(alpha);
// selected middle
S32 width = mGLFont->getWidth(mText.getWString().c_str(), mScrollHPos + rendered_text, select_right - mScrollHPos - rendered_text);
- width = llmin(width, mTextRightEdge - llround(rendered_pixels_right));
- gl_rect_2d(llround(rendered_pixels_right), cursor_top, llround(rendered_pixels_right)+width, cursor_bottom, color);
+ width = llmin(width, mTextRightEdge - ll_round(rendered_pixels_right));
+ gl_rect_2d(ll_round(rendered_pixels_right), cursor_top, ll_round(rendered_pixels_right)+width, cursor_bottom, color);
LLColor4 tmp_color( 1.f - text_color.mV[0], 1.f - text_color.mV[1], 1.f - text_color.mV[2], alpha );
rendered_text += mGLFont->render(
@@ -1855,7 +1855,7 @@ void LLLineEditor::draw()
0,
LLFontGL::NO_SHADOW,
select_right - mScrollHPos - rendered_text,
- mTextRightEdge - llround(rendered_pixels_right),
+ mTextRightEdge - ll_round(rendered_pixels_right),
&rendered_pixels_right);
}
@@ -1870,7 +1870,7 @@ void LLLineEditor::draw()
0,
LLFontGL::NO_SHADOW,
S32_MAX,
- mTextRightEdge - llround(rendered_pixels_right),
+ mTextRightEdge - ll_round(rendered_pixels_right),
&rendered_pixels_right);
}
}
@@ -1884,7 +1884,7 @@ void LLLineEditor::draw()
0,
LLFontGL::NO_SHADOW,
S32_MAX,
- mTextRightEdge - llround(rendered_pixels_right),
+ mTextRightEdge - ll_round(rendered_pixels_right),
&rendered_pixels_right);
}
#if 1 // for when we're ready for image art.
@@ -2044,7 +2044,7 @@ void LLLineEditor::draw()
0,
LLFontGL::NO_SHADOW,
S32_MAX,
- mTextRightEdge - llround(rendered_pixels_right),
+ mTextRightEdge - ll_round(rendered_pixels_right),
&rendered_pixels_right, FALSE);
}
@@ -2069,7 +2069,7 @@ void LLLineEditor::draw()
0,
LLFontGL::NO_SHADOW,
S32_MAX,
- mTextRightEdge - llround(rendered_pixels_right),
+ mTextRightEdge - ll_round(rendered_pixels_right),
&rendered_pixels_right, FALSE);
}
// Draw children (border)
@@ -2573,7 +2573,7 @@ void LLLineEditor::markAsPreedit(S32 position, S32 length)
S32 LLLineEditor::getPreeditFontSize() const
{
- return llround(mGLFont->getLineHeight() * LLUI::getScaleFactor().mV[VY]);
+ return ll_round(mGLFont->getLineHeight() * LLUI::getScaleFactor().mV[VY]);
}
void LLLineEditor::setReplaceNewlinesWithSpaces(BOOL replace)
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 604dc92789..e5081ee1d5 100755
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -100,17 +100,10 @@ const std::string LLMenuGL::ARROW_DOWN("vvvvvvv");
const F32 MAX_MOUSE_SLOPE_SUB_MENU = 0.9f;
-const S32 PIE_GESTURE_ACTIVATE_DISTANCE = 10;
-
BOOL LLMenuGL::sKeyboardMode = FALSE;
LLHandle<LLView> LLMenuHolderGL::sItemLastSelectedHandle;
LLFrameTimer LLMenuHolderGL::sItemActivationTimer;
-//LLColor4 LLMenuGL::sBackgroundColor( 0.8f, 0.8f, 0.0f, 1.0f );
-
-const S32 PIE_CENTER_SIZE = 20; // pixels, radius of center hole
-const F32 PIE_SCALE_FACTOR = 1.7f; // scale factor for pie menu when mouse is initially down
-const F32 PIE_SHRINK_TIME = 0.2f; // time of transition between unbounded and bounded display of pie menu
const F32 ACTIVATE_HIGHLIGHT_TIME = 0.3f;
@@ -1276,7 +1269,15 @@ void LLMenuItemBranchGL::openMenu()
{
// open upwards if menu extends past bottom
// adjust by the height of the menu item branch since it is a submenu
- delta_y = branch_rect.getHeight() - getRect().getHeight();
+ if (y + 2 * branch_rect.getHeight() - getRect().getHeight() > menu_region_rect.mTop)
+ {
+ // overlaps with top border, align with top
+ delta_y = menu_region_rect.mTop - y - branch_rect.getHeight();
+ }
+ else
+ {
+ delta_y = branch_rect.getHeight() - getRect().getHeight();
+ }
}
if( x + branch_rect.getWidth() > menu_region_rect.mRight )
@@ -1580,7 +1581,7 @@ void LLMenuItemBranchDownGL::draw( void )
std::string::size_type offset = upper_case_label.find(getJumpKey());
if (offset != std::string::npos)
{
- S32 x_offset = llround((F32)getRect().getWidth() / 2.f - getFont()->getWidthF32(mLabel.getString(), 0, S32_MAX) / 2.f);
+ S32 x_offset = ll_round((F32)getRect().getWidth() / 2.f - getFont()->getWidthF32(mLabel.getString(), 0, S32_MAX) / 2.f);
S32 x_begin = x_offset + getFont()->getWidth(mLabel, 0, offset);
S32 x_end = x_offset + getFont()->getWidth(mLabel, 0, offset + 1);
gl_line_2d(x_begin, LABEL_BOTTOM_PAD_PIXELS, x_end, LABEL_BOTTOM_PAD_PIXELS);
@@ -3012,8 +3013,8 @@ BOOL LLMenuGL::handleHover( S32 x, S32 y, MASK mask )
LLVector2 mouse_avg_dir((F32)mMouseVelX, (F32)mMouseVelY);
mouse_avg_dir.normVec();
F32 interp = 0.5f * (llclamp(mouse_dir * mouse_avg_dir, 0.f, 1.f));
- mMouseVelX = llround(lerp((F32)mouse_delta_x, (F32)mMouseVelX, interp));
- mMouseVelY = llround(lerp((F32)mouse_delta_y, (F32)mMouseVelY, interp));
+ mMouseVelX = ll_round(lerp((F32)mouse_delta_x, (F32)mMouseVelX, interp));
+ mMouseVelY = ll_round(lerp((F32)mouse_delta_y, (F32)mMouseVelY, interp));
mLastMouseX = x;
mLastMouseY = y;
@@ -3258,6 +3259,11 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y)
CURSOR_WIDTH + MOUSE_CURSOR_PADDING * 2,
CURSOR_HEIGHT + MOUSE_CURSOR_PADDING * 2);
menu->translateIntoRectWithExclusion( menu_region_rect, mouse_rect );
+ if (menu->getRect().mTop > menu_region_rect.mTop)
+ {
+ // not enough space: align with top, ignore exclusion
+ menu->translateIntoRect( menu_region_rect );
+ }
menu->getParent()->sendChildToFront(menu);
}
diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp
index 33e66add18..8cf88ad5eb 100755
--- a/indra/llui/llmodaldialog.cpp
+++ b/indra/llui/llmodaldialog.cpp
@@ -287,7 +287,7 @@ void LLModalDialog::draw()
void LLModalDialog::centerOnScreen()
{
LLVector2 window_size = LLUI::getWindowSize();
- centerWithin(LLRect(0, 0, llround(window_size.mV[VX]), llround(window_size.mV[VY])));
+ centerWithin(LLRect(0, 0, ll_round(window_size.mV[VX]), ll_round(window_size.mV[VY])));
}
diff --git a/indra/llui/llprogressbar.cpp b/indra/llui/llprogressbar.cpp
index 84a890edfa..209796565c 100755
--- a/indra/llui/llprogressbar.cpp
+++ b/indra/llui/llprogressbar.cpp
@@ -77,7 +77,7 @@ void LLProgressBar::draw()
LLColor4 bar_color = mColorBar.get();
bar_color.mV[VALPHA] *= alpha; // modulate alpha
LLRect progress_rect = getLocalRect();
- progress_rect.mRight = llround(getRect().getWidth() * (mPercentDone / 100.f));
+ progress_rect.mRight = ll_round(getRect().getWidth() * (mPercentDone / 100.f));
mImageFill->draw(progress_rect, bar_color);
}
diff --git a/indra/llui/llrngwriter.cpp b/indra/llui/llrngwriter.cpp
index cd9fe3610e..e4a31d6a79 100755
--- a/indra/llui/llrngwriter.cpp
+++ b/indra/llui/llrngwriter.cpp
@@ -28,7 +28,16 @@
#include "llrngwriter.h"
#include "lluicolor.h"
+
+#if LL_DARWIN
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdelete-incomplete"
+#include "lluictrlfactory.h"
+#pragma clang diagnostic pop
+#else
#include "lluictrlfactory.h"
+#endif
+
#include "boost/bind.hpp"
static LLInitParam::Parser::parser_read_func_map_t sReadFuncs;
diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp
index 8c506d76bb..f70eebc594 100755
--- a/indra/llui/llscrollcontainer.cpp
+++ b/indra/llui/llscrollcontainer.cpp
@@ -48,7 +48,6 @@
/// Local function declarations, constants, enums, and typedefs
///----------------------------------------------------------------------------
-static const S32 HORIZONTAL_MULTIPLE = 8;
static const S32 VERTICAL_MULTIPLE = 16;
static const F32 AUTO_SCROLL_RATE_ACCEL = 120.f;
@@ -315,7 +314,7 @@ bool LLScrollContainer::autoScroll(S32 x, S32 y)
// clip rect against root view
inner_rect_local.intersectWith(screen_local_extents);
- S32 auto_scroll_speed = llround(mAutoScrollRate * LLFrameTimer::getFrameDeltaTimeF32());
+ S32 auto_scroll_speed = ll_round(mAutoScrollRate * LLFrameTimer::getFrameDeltaTimeF32());
// autoscroll region should take up no more than one third of visible scroller area
S32 auto_scroll_region_width = llmin(inner_rect_local.getWidth() / 3, 10);
S32 auto_scroll_region_height = llmin(inner_rect_local.getHeight() / 3, 10);
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index 5f72ee3ac6..899a0bbab9 100755
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -648,7 +648,7 @@ bool LLScrollListCtrl::updateColumnWidths()
S32 new_width = 0;
if (column->mRelWidth >= 0)
{
- new_width = (S32)llround(column->mRelWidth*mItemListRect.getWidth());
+ new_width = (S32)ll_round(column->mRelWidth*mItemListRect.getWidth());
}
else if (column->mDynamicWidth)
{
@@ -2095,9 +2095,6 @@ BOOL LLScrollListCtrl::handleKeyHere(KEY key,MASK mask )
// not called from parent means we have keyboard focus or a child does
if (mCanSelect)
{
- // Ignore capslock
- mask = mask;
-
if (mask == MASK_NONE)
{
switch(key)
@@ -2682,7 +2679,7 @@ void LLScrollListCtrl::addColumn(const LLScrollListColumn::Params& column_params
}
if (new_column->mRelWidth >= 0)
{
- new_column->setWidth((S32)llround(new_column->mRelWidth*mItemListRect.getWidth()));
+ new_column->setWidth((S32)ll_round(new_column->mRelWidth*mItemListRect.getWidth()));
}
else if(new_column->mDynamicWidth)
{
diff --git a/indra/llui/llsliderctrl.cpp b/indra/llui/llsliderctrl.cpp
index 62c5ecb8f1..127c97ecde 100755
--- a/indra/llui/llsliderctrl.cpp
+++ b/indra/llui/llsliderctrl.cpp
@@ -43,8 +43,6 @@
#include "llresmgr.h"
#include "lluictrlfactory.h"
-const U32 MAX_STRING_LENGTH = 10;
-
static LLDefaultChildRegistry::Register<LLSliderCtrl> r("slider");
LLSliderCtrl::LLSliderCtrl(const LLSliderCtrl::Params& p)
diff --git a/indra/llui/llspinctrl.cpp b/indra/llui/llspinctrl.cpp
index ebdbdf59c0..8b1ba406c8 100755
--- a/indra/llui/llspinctrl.cpp
+++ b/indra/llui/llspinctrl.cpp
@@ -153,7 +153,7 @@ F32 clamp_precision(F32 value, S32 decimal_precision)
for (S32 i = 0; i < decimal_precision; i++)
clamped_value *= 10.0;
- clamped_value = llround((F32)clamped_value);
+ clamped_value = ll_round((F32)clamped_value);
for (S32 i = 0; i < decimal_precision; i++)
clamped_value /= 10.0;
diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp
index 1bd2bc06f4..35f5330a3f 100755
--- a/indra/llui/llstatbar.cpp
+++ b/indra/llui/llstatbar.cpp
@@ -638,7 +638,7 @@ void LLStatBar::drawLabelAndValue( F32 value, std::string &label, LLRect &bar_re
void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect )
{
- if (mAutoScaleMax || mAutoScaleMin)
+ if (!llisnan(min) && (mAutoScaleMax || mAutoScaleMin))
{
F32 u = LLSmoothInterpolation::getInterpolant(10.f);
mFloatingTargetMinBar = llmin(min, lerp(mFloatingTargetMinBar, min, u));
@@ -711,7 +711,7 @@ void LLStatBar::drawTicks( F32 min, F32 max, F32 value_scale, LLRect &bar_rect )
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()));
+ S32 label_pos = tick_begin - ll_round((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);
diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h
index 89d7ff24ed..1ff4c67fc5 100755
--- a/indra/llui/llstatbar.h
+++ b/indra/llui/llstatbar.h
@@ -80,7 +80,6 @@ private:
mFloatingTargetMaxBar,
mCurMaxBar,
mCurMinBar,
- mLabelSpacing,
mTickSpacing;
S32 mDecimalDigits,
mNumHistoryFrames,
diff --git a/indra/llui/llstatgraph.cpp b/indra/llui/llstatgraph.cpp
index 98962aff9a..3fe314e77a 100755
--- a/indra/llui/llstatgraph.cpp
+++ b/indra/llui/llstatgraph.cpp
@@ -111,7 +111,7 @@ void LLStatGraph::draw()
color = it->mColor;
gGL.color4fv(color.mV);
- gl_rect_2d(1, llround(frac*getRect().getHeight()), getRect().getWidth() - 1, 0, TRUE);
+ gl_rect_2d(1, ll_round(frac*getRect().getHeight()), getRect().getWidth() - 1, 0, TRUE);
}
void LLStatGraph::setMin(const F32 min)
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 9b125a85b9..367bc9a084 100755
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1556,7 +1556,7 @@ void LLTextBase::reflow()
line_count));
line_start_index = segment->getStart() + seg_offset;
- cur_top -= llround((F32)line_height * mLineSpacingMult) + mLineSpacingPixels;
+ cur_top -= ll_round((F32)line_height * mLineSpacingMult) + mLineSpacingPixels;
remaining_pixels = text_available_width;
line_height = 0;
}
@@ -1568,7 +1568,7 @@ void LLTextBase::reflow()
last_segment_char_on_line,
line_rect,
line_count));
- cur_top -= llround((F32)line_height * mLineSpacingMult) + mLineSpacingPixels;
+ cur_top -= ll_round((F32)line_height * mLineSpacingMult) + mLineSpacingPixels;
break;
}
// ...or finished a segment and there are segments remaining on this line
@@ -1583,7 +1583,7 @@ void LLTextBase::reflow()
line_rect,
line_count));
line_start_index = segment->getStart() + seg_offset;
- cur_top -= llround((F32)line_height * mLineSpacingMult) + mLineSpacingPixels;
+ cur_top -= ll_round((F32)line_height * mLineSpacingMult) + mLineSpacingPixels;
line_height = 0;
remaining_pixels = text_available_width;
}
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index cf5fdef539..c433f8ccab 100755
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -2840,7 +2840,7 @@ void LLTextEditor::markAsPreedit(S32 position, S32 length)
S32 LLTextEditor::getPreeditFontSize() const
{
- return llround((F32)mFont->getLineHeight() * LLUI::getScaleFactor().mV[VY]);
+ return ll_round((F32)mFont->getLineHeight() * LLUI::getScaleFactor().mV[VY]);
}
BOOL LLTextEditor::isDirty() const
diff --git a/indra/llui/lltextvalidate.cpp b/indra/llui/lltextvalidate.cpp
index 234e600ccd..324ceb7fba 100755
--- a/indra/llui/lltextvalidate.cpp
+++ b/indra/llui/lltextvalidate.cpp
@@ -336,7 +336,7 @@ namespace LLTextValidate
S32 len = str.length();
while(len--)
{
- if (str[len] < 0x20 && str[len] != 0xA || str[len] > 0x7f)
+ if ((str[len] < 0x20 && str[len] != 0xA) || str[len] > 0x7f)
{
rv = FALSE;
break;
diff --git a/indra/llui/lltimectrl.cpp b/indra/llui/lltimectrl.cpp
index 9ea1e8815e..516057f8fd 100755
--- a/indra/llui/lltimectrl.cpp
+++ b/indra/llui/lltimectrl.cpp
@@ -153,7 +153,7 @@ U32 LLTimeCtrl::getMinutes() const
void LLTimeCtrl::setTime24(F32 time)
{
time = llclamp(time, 0.0f, 23.99f); // fix out of range values
- mTime = llround(time * MINUTES_PER_HOUR); // fixes values like 4.99999
+ mTime = ll_round(time * MINUTES_PER_HOUR); // fixes values like 4.99999
updateText();
}
@@ -381,7 +381,7 @@ bool LLTimeCtrl::isHoursStringValid(const std::string& str)
bool LLTimeCtrl::isMinutesStringValid(const std::string& str)
{
U32 minutes;
- if (!LLStringUtil::convertToU32(str, minutes) || (minutes <= MINUTES_MAX) && str.length() < 3)
+ if (!LLStringUtil::convertToU32(str, minutes) || ((minutes <= MINUTES_MAX) && str.length() < 3))
return true;
return false;
@@ -415,7 +415,8 @@ U32 LLTimeCtrl::parseHours(const std::string& str)
U32 LLTimeCtrl::parseMinutes(const std::string& str)
{
U32 minutes;
- if (LLStringUtil::convertToU32(str, minutes) && (minutes >= MINUTES_MIN) && (minutes <= MINUTES_MAX))
+ // not sure of this fix - clang doesnt like compare minutes U32 to >= MINUTES_MIN (0) but MINUTES_MIN can change
+ if (LLStringUtil::convertToU32(str, minutes) && ((S32)minutes >= MINUTES_MIN) && ((S32)minutes <= MINUTES_MAX))
{
return minutes;
}
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp
index 1f570edd88..aabc7ed2e4 100755
--- a/indra/llui/llui.cpp
+++ b/indra/llui/llui.cpp
@@ -236,8 +236,8 @@ void LLUI::dirtyRect(LLRect rect)
void LLUI::setMousePositionScreen(S32 x, S32 y)
{
S32 screen_x, screen_y;
- screen_x = llround((F32)x * getScaleFactor().mV[VX]);
- screen_y = llround((F32)y * getScaleFactor().mV[VY]);
+ screen_x = ll_round((F32)x * getScaleFactor().mV[VX]);
+ screen_y = ll_round((F32)y * getScaleFactor().mV[VY]);
LLView::getWindow()->setCursorPosition(LLCoordGL(screen_x, screen_y).convert());
}
@@ -248,8 +248,8 @@ void LLUI::getMousePositionScreen(S32 *x, S32 *y)
LLCoordWindow cursor_pos_window;
getWindow()->getCursorPosition(&cursor_pos_window);
LLCoordGL cursor_pos_gl(cursor_pos_window.convert());
- *x = llround((F32)cursor_pos_gl.mX / getScaleFactor().mV[VX]);
- *y = llround((F32)cursor_pos_gl.mY / getScaleFactor().mV[VX]);
+ *x = ll_round((F32)cursor_pos_gl.mX / getScaleFactor().mV[VX]);
+ *y = ll_round((F32)cursor_pos_gl.mY / getScaleFactor().mV[VX]);
}
//static
@@ -369,15 +369,15 @@ LLVector2 LLUI::getWindowSize()
//static
void LLUI::screenPointToGL(S32 screen_x, S32 screen_y, S32 *gl_x, S32 *gl_y)
{
- *gl_x = llround((F32)screen_x * getScaleFactor().mV[VX]);
- *gl_y = llround((F32)screen_y * getScaleFactor().mV[VY]);
+ *gl_x = ll_round((F32)screen_x * getScaleFactor().mV[VX]);
+ *gl_y = ll_round((F32)screen_y * getScaleFactor().mV[VY]);
}
//static
void LLUI::glPointToScreen(S32 gl_x, S32 gl_y, S32 *screen_x, S32 *screen_y)
{
- *screen_x = llround((F32)gl_x / getScaleFactor().mV[VX]);
- *screen_y = llround((F32)gl_y / getScaleFactor().mV[VY]);
+ *screen_x = ll_round((F32)gl_x / getScaleFactor().mV[VX]);
+ *screen_y = ll_round((F32)gl_y / getScaleFactor().mV[VY]);
}
//static
diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h
index a5796c8af2..3ce39c947f 100755
--- a/indra/llui/lluictrlfactory.h
+++ b/indra/llui/lluictrlfactory.h
@@ -183,7 +183,15 @@ public:
if (!widget)
{
LL_WARNS() << "Widget in " << filename << " was of type " << typeid(view).name() << " instead of expected type " << typeid(T).name() << LL_ENDL;
+
+#if LL_DARWIN
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdelete-incomplete"
+ delete view;
+#pragma clang diagnostic pop
+#else
delete view;
+#endif
view = NULL;
}
}
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp
index 6f3122e7a1..c058ad6f7d 100755
--- a/indra/llui/llurlentry.cpp
+++ b/indra/llui/llurlentry.cpp
@@ -178,6 +178,12 @@ bool LLUrlEntryBase::isLinkDisabled() const
return globally_disabled;
}
+bool LLUrlEntryBase::isWikiLinkCorrect(std::string url)
+{
+ std::string label = getLabelFromWikiLink(url);
+ return (LLUrlRegistry::instance().hasUrl(label)) ? false : true;
+}
+
static std::string getStringAfterToken(const std::string str, const std::string token)
{
size_t pos = str.find(token);
@@ -835,9 +841,9 @@ void LLUrlEntryParcel::processParcelInfo(const LLParcelData& parcel_data)
// If parcel name is empty use Sim_name (x, y, z) for parcel label.
else if (!parcel_data.sim_name.empty())
{
- S32 region_x = llround(parcel_data.global_x) % REGION_WIDTH_UNITS;
- S32 region_y = llround(parcel_data.global_y) % REGION_WIDTH_UNITS;
- S32 region_z = llround(parcel_data.global_z);
+ S32 region_x = ll_round(parcel_data.global_x) % REGION_WIDTH_UNITS;
+ S32 region_y = ll_round(parcel_data.global_y) % REGION_WIDTH_UNITS;
+ S32 region_z = ll_round(parcel_data.global_z);
label = llformat("%s (%d, %d, %d)",
parcel_data.sim_name.c_str(), region_x, region_y, region_z);
diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h
index d4684e2e1e..ffcd45dfde 100755
--- a/indra/llui/llurlentry.h
+++ b/indra/llui/llurlentry.h
@@ -100,6 +100,8 @@ public:
bool isLinkDisabled() const;
+ bool isWikiLinkCorrect(std::string url);
+
protected:
std::string getIDStringFromUrl(const std::string &url) const;
std::string escapeUrl(const std::string &url) const;
diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp
index bccc646821..ef0789e0e4 100755
--- a/indra/llui/llurlregistry.cpp
+++ b/indra/llui/llurlregistry.cpp
@@ -45,7 +45,8 @@ LLUrlRegistry::LLUrlRegistry()
registerUrl(mUrlEntryIcon);
registerUrl(new LLUrlEntrySLURL());
registerUrl(new LLUrlEntryHTTP());
- registerUrl(new LLUrlEntryHTTPLabel());
+ mUrlEntryHTTPLabel = new LLUrlEntryHTTPLabel();
+ registerUrl(mUrlEntryHTTPLabel);
registerUrl(new LLUrlEntryAgentCompleteName());
registerUrl(new LLUrlEntryAgentDisplayName());
registerUrl(new LLUrlEntryAgentUserName());
@@ -64,7 +65,8 @@ LLUrlRegistry::LLUrlRegistry()
//LLUrlEntrySL and LLUrlEntrySLLabel have more common pattern,
//so it should be registered in the end of list
registerUrl(new LLUrlEntrySL());
- registerUrl(new LLUrlEntrySLLabel());
+ mUrlEntrySLLabel = new LLUrlEntrySLLabel();
+ registerUrl(mUrlEntrySLLabel);
// most common pattern is a URL without any protocol,
// e.g., "secondlife.com"
registerUrl(new LLUrlEntryHTTPNoProtocol());
@@ -128,6 +130,11 @@ static bool matchRegex(const char *text, boost::regex regex, U32 &start, U32 &en
end--;
}
+ else if (text[end] == ']' && std::string(text+start, end-start).find('[') == std::string::npos)
+ {
+ end--;
+ }
+
return true;
}
@@ -175,6 +182,15 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL
// does this match occur in the string before any other match
if (start < match_start || match_entry == NULL)
{
+
+ if((mUrlEntryHTTPLabel == *it) || (mUrlEntrySLLabel == *it))
+ {
+ if(url_entry && !url_entry->isWikiLinkCorrect(text.substr(start, end - start + 1)))
+ {
+ continue;
+ }
+ }
+
match_start = start;
match_end = end;
match_entry = url_entry;
diff --git a/indra/llui/llurlregistry.h b/indra/llui/llurlregistry.h
index 6270df1bbb..1cb403dfc9 100755
--- a/indra/llui/llurlregistry.h
+++ b/indra/llui/llurlregistry.h
@@ -94,6 +94,8 @@ private:
std::vector<LLUrlEntryBase *> mUrlEntry;
LLUrlEntryBase* mUrlEntryIcon;
+ LLUrlEntryBase* mUrlEntryHTTPLabel;
+ LLUrlEntryBase* mUrlEntrySLLabel;
};
#endif
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 77c8878f4b..a8beb9cfc9 100755
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -885,7 +885,7 @@ BOOL LLView::handleKey(KEY key, MASK mask, BOOL called_from_parent)
handled = handleKeyHere( key, mask );
if (handled)
{
- LL_WARNS() << "Key handled by " << getName() << LL_ENDL;
+ LL_DEBUGS() << "Key handled by " << getName() << LL_ENDL;
}
}
}
@@ -2164,10 +2164,6 @@ LLControlVariable *LLView::findControl(const std::string& name)
return control_group.getControl(name);
}
-const S32 FLOATER_H_MARGIN = 15;
-const S32 MIN_WIDGET_HEIGHT = 10;
-const S32 VPAD = 4;
-
void LLView::initFromParams(const LLView::Params& params)
{
LLRect required_rect = getRequiredRect();
diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp
index 37d88cb9f9..99a0869ce3 100755
--- a/indra/llui/llxuiparser.cpp
+++ b/indra/llui/llxuiparser.cpp
@@ -58,7 +58,9 @@ static LLInitParam::Parser::parser_inspect_func_map_t sSimpleXUIInspectFuncs;
const char* NO_VALUE_MARKER = "no_value";
+#ifdef LL_WINDOWS
const S32 LINE_NUMBER_HERE = 0;
+#endif
struct MaxOccursValues : public LLInitParam::TypeValuesHelper<U32, MaxOccursValues>
{
diff --git a/indra/llvfs/lldiriterator.cpp b/indra/llvfs/lldiriterator.cpp
index a9d96c9807..76296ff877 100755
--- a/indra/llvfs/lldiriterator.cpp
+++ b/indra/llvfs/lldiriterator.cpp
@@ -127,7 +127,8 @@ bool LLDirIterator::Impl::next(std::string &fname)
{
boost::smatch match;
std::string name = mIter->path().filename().string();
- if (found = boost::regex_match(name, match, mFilterExp))
+ found = boost::regex_match(name, match, mFilterExp);
+ if (found)
{
fname = name;
}
diff --git a/indra/llvfs/llvfs_objc.h b/indra/llvfs/llvfs_objc.h
index 90101eb2e9..56cdbebfc5 100755
--- a/indra/llvfs/llvfs_objc.h
+++ b/indra/llvfs/llvfs_objc.h
@@ -40,4 +40,4 @@ std::string* getSystemResourceFolder();
std::string* getSystemExecutableFolder();
-#endif LL_LLVFS_OBJC_H
+#endif // LL_LLVFS_OBJC_H
diff --git a/indra/llvfs/llvfs_objc.mm b/indra/llvfs/llvfs_objc.mm
index 47b0e73978..282ea41339 100755
--- a/indra/llvfs/llvfs_objc.mm
+++ b/indra/llvfs/llvfs_objc.mm
@@ -48,7 +48,7 @@ std::string* findSystemDirectory(NSSearchPathDirectory searchPathDirectory,
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- std::string *result;
+ std::string *result = nil;
NSString *path = nil;
// Search for the path
diff --git a/indra/llwindow/llopenglview-objc.h b/indra/llwindow/llopenglview-objc.h
index f1fab3b2c6..072d40f739 100644
--- a/indra/llwindow/llopenglview-objc.h
+++ b/indra/llwindow/llopenglview-objc.h
@@ -79,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 f7031341eb..959dbc1040 100644
--- a/indra/llwindow/llopenglview-objc.mm
+++ b/indra/llwindow/llopenglview-objc.mm
@@ -104,26 +104,34 @@ attributedStringInfo getSegments(NSAttributedString *str)
- (unsigned long)getVramSize
{
CGLRendererInfoObj info = 0;
- GLint vram_bytes = 0;
+ GLint vram_megabytes = 0;
int num_renderers = 0;
CGLError the_err = CGLQueryRendererInfo (CGDisplayIDToOpenGLDisplayMask(kCGDirectMainDisplay), &info, &num_renderers);
if(0 == the_err)
{
- CGLDescribeRenderer (info, 0, kCGLRPTextureMemory, &vram_bytes);
+ CGLDescribeRenderer (info, 0, kCGLRPTextureMemoryMegabytes, &vram_megabytes);
CGLDestroyRendererInfo (info);
}
else
{
- vram_bytes = (256 << 20);
+ vram_megabytes = 256;
}
- return (unsigned long)vram_bytes / 1048576; // We need this in megabytes.
+ return (unsigned long)vram_megabytes; // return value is in megabytes.
}
- (void)viewDidMoveToWindow
{
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(windowResized:) name:NSWindowDidResizeNotification
+ object:[self window]];
+
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(windowWillMiniaturize:) name:NSWindowWillMiniaturizeNotification
+ object:[self window]];
+
+ [[NSNotificationCenter defaultCenter] addObserver:self
+ selector:@selector(windowDidDeminiaturize:) name:NSWindowDidDeminiaturizeNotification
object:[self window]];
}
@@ -141,6 +149,16 @@ attributedStringInfo getSegments(NSAttributedString *str)
}
}
+- (void)windowWillMiniaturize:(NSNotification *)notification;
+{
+ callWindowHide();
+}
+
+- (void)windowDidDeminiaturize:(NSNotification *)notification;
+{
+ callWindowUnhide();
+}
+
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
@@ -270,14 +288,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]);
}
}
}
@@ -286,21 +304,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
@@ -341,17 +359,22 @@ 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) rightMouseDragged:(NSEvent *)theEvent
+{
+ [self mouseDragged:theEvent];
}
- (void) otherMouseDragged:(NSEvent *)theEvent
{
-
+ [self mouseDragged:theEvent];
}
- (void) scrollWheel:(NSEvent *)theEvent
@@ -366,22 +389,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
@@ -498,31 +526,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];
}
}
}
@@ -641,37 +696,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/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h
index d64525fbdd..f02052ca6a 100755
--- a/indra/llwindow/llwindowmacosx-objc.h
+++ b/indra/llwindow/llwindowmacosx-objc.h
@@ -116,6 +116,8 @@ void callScrollMoved(float delta);
void callMouseExit();
void callWindowFocus();
void callWindowUnfocus();
+void callWindowHide();
+void callWindowUnhide();
void callDeltaUpdate(float *delta, unsigned int mask);
void callMiddleMouseDown(float *pos, unsigned int mask);
void callMiddleMouseUp(float *pos, unsigned int mask);
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index 18d5152015..b2f1d618ef 100755
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -44,15 +44,9 @@
extern BOOL gDebugWindowProc;
-// culled from winuser.h
-//const S32 WHEEL_DELTA = 120; /* Value for rolling one detent */
-// On the Mac, the scroll wheel reports a delta of 1 for each detent.
-// There's also acceleration for faster scrolling, based on a slider in the system preferences.
-const S32 WHEEL_DELTA = 1; /* Value for rolling one detent */
const S32 BITS_PER_PIXEL = 32;
const S32 MAX_NUM_RESOLUTIONS = 32;
-
//
// LLWindowMacOSX
//
@@ -230,7 +224,10 @@ void callFocus()
void callFocusLost()
{
- gWindowImplementation->getCallbacks()->handleFocusLost(gWindowImplementation);
+ if (gWindowImplementation)
+ {
+ gWindowImplementation->getCallbacks()->handleFocusLost(gWindowImplementation);
+ }
}
void callRightMouseDown(float *pos, MASK mask)
@@ -241,8 +238,8 @@ void callRightMouseDown(float *pos, MASK mask)
}
LLCoordGL outCoords;
- outCoords.mX = llround(pos[0]);
- outCoords.mY = llround(pos[1]);
+ outCoords.mX = ll_round(pos[0]);
+ outCoords.mY = ll_round(pos[1]);
gWindowImplementation->getCallbacks()->handleRightMouseDown(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE));
}
@@ -254,8 +251,8 @@ void callRightMouseUp(float *pos, MASK mask)
}
LLCoordGL outCoords;
- outCoords.mX = llround(pos[0]);
- outCoords.mY = llround(pos[1]);
+ outCoords.mX = ll_round(pos[0]);
+ outCoords.mY = ll_round(pos[1]);
gWindowImplementation->getCallbacks()->handleRightMouseUp(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE));
}
@@ -267,8 +264,8 @@ void callLeftMouseDown(float *pos, MASK mask)
}
LLCoordGL outCoords;
- outCoords.mX = llround(pos[0]);
- outCoords.mY = llround(pos[1]);
+ outCoords.mX = ll_round(pos[0]);
+ outCoords.mY = ll_round(pos[1]);
gWindowImplementation->getCallbacks()->handleMouseDown(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE));
}
@@ -280,8 +277,8 @@ void callLeftMouseUp(float *pos, MASK mask)
}
LLCoordGL outCoords;
- outCoords.mX = llround(pos[0]);
- outCoords.mY = llround(pos[1]);
+ outCoords.mX = ll_round(pos[0]);
+ outCoords.mY = ll_round(pos[1]);
gWindowImplementation->getCallbacks()->handleMouseUp(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE));
}
@@ -294,8 +291,8 @@ void callDoubleClick(float *pos, MASK mask)
}
LLCoordGL outCoords;
- outCoords.mX = llround(pos[0]);
- outCoords.mY = llround(pos[1]);
+ outCoords.mX = ll_round(pos[0]);
+ outCoords.mY = ll_round(pos[1]);
gWindowImplementation->getCallbacks()->handleDoubleClick(gWindowImplementation, outCoords, gKeyboard->currentMask(TRUE));
}
@@ -310,8 +307,8 @@ void callResize(unsigned int width, unsigned int height)
void callMouseMoved(float *pos, MASK mask)
{
LLCoordGL outCoords;
- outCoords.mX = llround(pos[0]);
- outCoords.mY = llround(pos[1]);
+ outCoords.mX = ll_round(pos[0]);
+ outCoords.mY = ll_round(pos[1]);
float deltas[2];
gWindowImplementation->getMouseDeltas(deltas);
outCoords.mX += deltas[0];
@@ -349,6 +346,22 @@ void callWindowUnfocus()
gWindowImplementation->getCallbacks()->handleFocusLost(gWindowImplementation);
}
+void callWindowHide()
+{
+ if ( gWindowImplementation && gWindowImplementation->getCallbacks() )
+ {
+ gWindowImplementation->getCallbacks()->handleActivate(gWindowImplementation, false);
+ }
+}
+
+void callWindowUnhide()
+{
+ if ( gWindowImplementation && gWindowImplementation->getCallbacks() )
+ {
+ gWindowImplementation->getCallbacks()->handleActivate(gWindowImplementation, true);
+ }
+}
+
void callDeltaUpdate(float *delta, MASK mask)
{
gWindowImplementation->updateMouseDeltas(delta);
@@ -357,8 +370,8 @@ void callDeltaUpdate(float *delta, MASK mask)
void callMiddleMouseDown(float *pos, MASK mask)
{
LLCoordGL outCoords;
- outCoords.mX = llround(pos[0]);
- outCoords.mY = llround(pos[1]);
+ outCoords.mX = ll_round(pos[0]);
+ outCoords.mY = ll_round(pos[1]);
float deltas[2];
gWindowImplementation->getMouseDeltas(deltas);
outCoords.mX += deltas[0];
@@ -369,8 +382,8 @@ void callMiddleMouseDown(float *pos, MASK mask)
void callMiddleMouseUp(float *pos, MASK mask)
{
LLCoordGL outCoords;
- outCoords.mX = llround(pos[0]);
- outCoords.mY = llround(pos[1]);
+ outCoords.mX = ll_round(pos[0]);
+ outCoords.mY = ll_round(pos[1]);
float deltas[2];
gWindowImplementation->getMouseDeltas(deltas);
outCoords.mX += deltas[0];
@@ -506,8 +519,8 @@ void LLWindowMacOSX::updateMouseDeltas(float* deltas)
{
if (mCursorDecoupled)
{
- mCursorLastEventDeltaX = llround(deltas[0]);
- mCursorLastEventDeltaY = llround(-deltas[1]);
+ mCursorLastEventDeltaX = ll_round(deltas[0]);
+ mCursorLastEventDeltaY = ll_round(-deltas[1]);
if (mCursorIgnoreNextDelta)
{
@@ -1805,8 +1818,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
@@ -1836,6 +1847,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()
diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp
index cb99496ef1..455df13e48 100755
--- a/indra/llxml/llxmlnode.cpp
+++ b/indra/llxml/llxmlnode.cpp
@@ -43,8 +43,6 @@
#include "lluuid.h"
#include "lldir.h"
-const S32 MAX_COLUMN_WIDTH = 80;
-
// static
BOOL LLXMLNode::sStripEscapedStrings = TRUE;
BOOL LLXMLNode::sStripWhitespaceValues = FALSE;
diff --git a/indra/lscript/lscript_execute/lscript_readlso.cpp b/indra/lscript/lscript_execute/lscript_readlso.cpp
index 7ec56c2409..abcb28e998 100755
--- a/indra/lscript/lscript_execute/lscript_readlso.cpp
+++ b/indra/lscript/lscript_execute/lscript_readlso.cpp
@@ -114,7 +114,7 @@ void LLScriptLSOParse::printRegisters(LLFILE *fp)
else if (gMajorVersion == LSL2_MAJOR_VERSION_TWO)
{
U64 data = get_register_u64(mRawData, (LSCRIPTRegisters)i);
- fprintf(fp, "%s: 0x%X%X\n", gLSCRIPTRegisterNames[i], (U32)(data>>32), (U32)(data && 0xFFFFFFFF));
+ fprintf(fp, "%s: 0x%X%X\n", gLSCRIPTRegisterNames[i], (U32)(data>>32), (U32)(data & 0xFFFFFFFF));
}
}
fprintf(fp, "=============================\n\n");
diff --git a/indra/media_plugins/example/media_plugin_example.cpp b/indra/media_plugins/example/media_plugin_example.cpp
index da7de01799..66c00cd58c 100755
--- a/indra/media_plugins/example/media_plugin_example.cpp
+++ b/indra/media_plugins/example/media_plugin_example.cpp
@@ -363,10 +363,10 @@ void MediaPluginExample::update( F64 milliseconds )
};
if ( mXpos[ n ] + mXInc[ n ] < 0 || mXpos[ n ] + mXInc[ n ] >= mWidth - mBlockSize[ n ] )
- mXInc[ n ] =- mXInc[ n ];
+ mXInc[ n ]= -mXInc[ n ];
if ( mYpos[ n ] + mYInc[ n ] < 0 || mYpos[ n ] + mYInc[ n ] >= mHeight - mBlockSize[ n ] )
- mYInc[ n ] =- mYInc[ n ];
+ mYInc[ n ]= -mYInc[ n ];
mXpos[ n ] += mXInc[ n ];
mYpos[ n ] += mYInc[ n ];
diff --git a/indra/media_plugins/winmmshim/forwarding_api.cpp b/indra/media_plugins/winmmshim/forwarding_api.cpp
index 495e08942b..33f0675028 100755
--- a/indra/media_plugins/winmmshim/forwarding_api.cpp
+++ b/indra/media_plugins/winmmshim/forwarding_api.cpp
@@ -1338,7 +1338,7 @@ extern "C" {
return joySetThreshold_orig( uJoyID, uThreshold);
}
- BOOL WINAPI mciDriverNotify(HWND hwndCallback, UINT uDeviceID, UINT uStatus)
+ BOOL WINAPI mciDriverNotify(HANDLE hwndCallback, MCIDEVICEID uDeviceID, UINT uStatus)
{
ll_winmm_shim_initialize();
//OutputDebugString(L"mciDriverNotify\n");
@@ -1610,7 +1610,7 @@ extern "C" {
return mciGetYieldProc_orig( mciId, pdwYieldData);
}
- UINT WINAPI mciLoadCommandResource(HINSTANCE hInstance, LPCWSTR lpResName, UINT uType)
+ UINT WINAPI mciLoadCommandResource(HANDLE hInstance, LPCWSTR lpResName, UINT uType)
{
ll_winmm_shim_initialize();
//OutputDebugString(L"mciLoadCommandResource");
diff --git a/indra/media_plugins/winmmshim/forwarding_api.h b/indra/media_plugins/winmmshim/forwarding_api.h
index 076a08f769..1418fc9e1d 100755
--- a/indra/media_plugins/winmmshim/forwarding_api.h
+++ b/indra/media_plugins/winmmshim/forwarding_api.h
@@ -306,7 +306,7 @@ typedef MMRESULT (WINAPI *joySetCapture_type)( HWND hwnd, UINT uJoyID, UINT uPer
extern joySetCapture_type joySetCapture_orig;
typedef MMRESULT (WINAPI *joySetThreshold_type)( UINT uJoyID, UINT uThreshold);
extern joySetThreshold_type joySetThreshold_orig;
-typedef BOOL (WINAPI *mciDriverNotify_type)(HWND hwndCallback, UINT uDeviceID, UINT uStatus);
+typedef BOOL(WINAPI *mciDriverNotify_type)(HANDLE hwndCallback, MCIDEVICEID uDeviceID, UINT uStatus);
extern mciDriverNotify_type mciDriverNotify_orig;
typedef UINT (WINAPI *mciDriverYield_type)(UINT uDeviceID);
extern mciDriverYield_type mciDriverYield_orig;
@@ -384,7 +384,7 @@ typedef HTASK (WINAPI *mciGetCreatorTask_type)( MCIDEVICEID mciId);
extern mciGetCreatorTask_type mciGetCreatorTask_orig;
typedef YIELDPROC (WINAPI *mciGetYieldProc_type)( MCIDEVICEID mciId, LPDWORD pdwYieldData);
extern mciGetYieldProc_type mciGetYieldProc_orig;
-typedef UINT (WINAPI *mciLoadCommandResource_type)(HINSTANCE hInstance, LPCWSTR lpResName, UINT uType);
+typedef UINT (WINAPI *mciLoadCommandResource_type)(HANDLE hInstance, LPCWSTR lpResName, UINT uType);
extern mciLoadCommandResource_type mciLoadCommandResource_orig;
typedef BOOL (WINAPI *mciExecute_type)(LPCSTR pszCommand);
extern mciExecute_type mciExecute_orig;
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index d1b0aae542..2b66a5fb94 100755
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -4,17 +4,19 @@ project(viewer)
include(00-Common)
include(Boost)
+include(BuildPackagesInfo)
include(BuildVersion)
+include(CMakeCopyIfDifferent)
include(DBusGlib)
include(DirectX)
-include(OpenSSL)
include(DragDrop)
include(EXPAT)
include(FMODEX)
-include(OPENAL)
-include(OpenGL)
+include(GLOD)
+include(GooglePerfTools)
include(Hunspell)
include(JsonCpp)
+include(LLAppearance)
include(LLAudio)
include(LLCharacter)
include(LLCommon)
@@ -22,6 +24,8 @@ include(LLCoreHttp)
include(LLImage)
include(LLImageJ2COJ)
include(LLInventory)
+include(LLKDU)
+include(LLLogin)
include(LLMath)
include(LLMessage)
include(LLPhysicsExtensions)
@@ -36,18 +40,16 @@ include(LScript)
include(Linking)
include(NDOF)
include(NVAPI)
-include(GooglePerfTools)
+include(OPENAL)
+include(OpenGL)
+include(OpenSSL)
+include(PNG)
+include(Prebuilt)
include(TemplateCheck)
include(UI)
include(UnixInstall)
-include(LLKDU)
include(ViewerMiscLibs)
-include(LLLogin)
include(VisualLeakDetector)
-include(GLOD)
-include(CMakeCopyIfDifferent)
-include(LLAppearance)
-include(PNG)
include(ZLIB)
if (NOT HAVOK_TPV)
@@ -59,6 +61,9 @@ if(FMODEX)
include_directories(${FMODEX_INCLUDE_DIR})
endif(FMODEX)
+# install SLPlugin host executable and its dynamic-library plugins
+use_prebuilt_binary(slplugins)
+
include_directories(
${DBUSGLIB_INCLUDE_DIRS}
${JSONCPP_INCLUDE_DIR}
@@ -1306,7 +1311,7 @@ set(viewer_HEADER_FILES
source_group("CMake Rules" FILES ViewerInstall.cmake)
-# the viewer_version.txt file created here is for passing to viewer_manifest
+# the viewer_version.txt file created here is for passing to viewer_manifest and autobuild
# the summary.json file is created for the benefit of the TeamCity builds, where
# it is used to provide descriptive information to the build results page
add_custom_target(generate_viewer_version ALL
@@ -1377,6 +1382,9 @@ if (LINUX)
set(viewer_LIBRARIES
Xinerama
)
+ if (OPENAL)
+ LIST(APPEND viewer_LIBRARIES ${OPENAL_LIBRARIES})
+ endif (OPENAL)
endif (LINUX)
if (WINDOWS)
@@ -1591,6 +1599,7 @@ set(viewer_APPSETTINGS_FILES
app_settings/viewerart.xml
${CMAKE_SOURCE_DIR}/../etc/message.xml
${CMAKE_SOURCE_DIR}/../scripts/messages/message_template.msg
+ packages-info.txt
)
source_group("App Settings" FILES ${viewer_APPSETTINGS_FILES})
@@ -1671,6 +1680,9 @@ if (WINDOWS)
LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\" /INCREMENTAL:NO /LARGEADDRESSAWARE"
LINK_FLAGS_RELEASE "/FORCE:MULTIPLE /MAP\"secondlife-bin.MAP\" /OPT:REF /LARGEADDRESSAWARE"
)
+
+ add_dependencies(${VIEWER_BINARY_NAME} generate_viewer_version)
+
if(USE_PRECOMPILED_HEADERS)
set_target_properties(
${VIEWER_BINARY_NAME}
@@ -1806,7 +1818,6 @@ if (WINDOWS)
--touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/copy_touched.bat
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
- generate_viewer_version
stage_third_party_libs
${COPY_INPUT_DEPENDENCIES}
COMMENT "Performing viewer_manifest copy"
@@ -1820,10 +1831,10 @@ if (WINDOWS)
add_dependencies(${VIEWER_BINARY_NAME} copy_win_scripts)
endif (EXISTS ${CMAKE_SOURCE_DIR}/copy_win_scripts)
- add_dependencies(${VIEWER_BINARY_NAME}
- SLPlugin
- windows-crash-logger
- )
+## add_dependencies(${VIEWER_BINARY_NAME}
+## SLPlugin
+## windows-crash-logger
+## )
# sets the 'working directory' for debugging from visual studio.
if (NOT UNATTENDED)
@@ -1878,10 +1889,9 @@ if (WINDOWS)
${COPY_INPUT_DEPENDENCIES}
)
- add_custom_target(package ALL DEPENDS
+ add_custom_target(llpackage ALL DEPENDS
${CMAKE_CFG_INTDIR}/touched.bat
windows-setup-build-all
- generate_viewer_version
)
# temporarily disable packaging of event_host until hg subrepos get
# sorted out on the parabuild cluster...
@@ -1990,12 +2000,14 @@ if (LINUX)
set(COPY_INPUT_DEPENDENCIES
${VIEWER_BINARY_NAME}
linux-crash-logger
- SLPlugin
- media_plugin_webkit
- media_plugin_gstreamer010
+## SLPlugin
+## media_plugin_webkit
+## media_plugin_gstreamer010
llcommon
)
+ add_dependencies(${VIEWER_BINARY_NAME} generate_viewer_version)
+
add_custom_command(
OUTPUT ${product}.tar.bz2
COMMAND ${PYTHON_EXECUTABLE}
@@ -2014,7 +2026,6 @@ if (LINUX)
--touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
- generate_viewer_version
${COPY_INPUT_DEPENDENCIES}
)
@@ -2039,7 +2050,6 @@ if (LINUX)
--source=${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
- generate_viewer_version
${COPY_INPUT_DEPENDENCIES}
COMMENT "Performing viewer_manifest copy"
)
@@ -2047,10 +2057,10 @@ if (LINUX)
add_custom_target(copy_l_viewer_manifest ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.copy_touched)
if (PACKAGE)
- add_custom_target(package ALL DEPENDS ${product}.tar.bz2)
+ add_custom_target(llpackage ALL DEPENDS ${product}.tar.bz2)
# Make sure we don't run two instances of viewer_manifest.py at the same time.
- add_dependencies(package copy_l_viewer_manifest)
- check_message_template(package)
+ add_dependencies(llpackage copy_l_viewer_manifest)
+ check_message_template(llpackage)
endif (PACKAGE)
endif (LINUX)
@@ -2081,6 +2091,8 @@ if (DARWIN)
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app/Contents/Info.plist"
)
+ add_dependencies(${VIEWER_BINARY_NAME} generate_viewer_version)
+
add_custom_command(
TARGET ${VIEWER_BINARY_NAME} POST_BUILD
COMMAND ${PYTHON_EXECUTABLE}
@@ -2100,10 +2112,10 @@ if (DARWIN)
DEPENDS
${VIEWER_BINARY_NAME}
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
- generate_viewer_version
)
- add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit mac-crash-logger)
+##add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit mac-crash-logger)
+ add_dependencies(${VIEWER_BINARY_NAME} mac-crash-logger)
if (ENABLE_SIGNING)
set(SIGNING_SETTING "--signature=${SIGNING_IDENTITY}")
@@ -2112,11 +2124,11 @@ if (DARWIN)
endif (ENABLE_SIGNING)
if (PACKAGE)
- add_custom_target(package ALL DEPENDS ${VIEWER_BINARY_NAME})
- add_dependencies(package generate_viewer_version)
+ add_custom_target(llpackage ALL DEPENDS ${VIEWER_BINARY_NAME})
+ add_dependencies(llpackage generate_viewer_version)
add_custom_command(
- TARGET package POST_BUILD
+ TARGET llpackage POST_BUILD
COMMAND ${PYTHON_EXECUTABLE}
ARGS
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
@@ -2135,7 +2147,6 @@ if (DARWIN)
${SIGNING_SETTING}
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
- generate_viewer_version
)
endif (PACKAGE)
endif (DARWIN)
@@ -2158,19 +2169,21 @@ if (PACKAGE)
if (DARWIN)
list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}")
# *TODO: Generate these search dirs in the cmake files related to each binary.
- list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/llplugin/slplugin/${CMAKE_CFG_INTDIR}")
+## list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/llplugin/slplugin/${CMAKE_CFG_INTDIR}")
list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/mac_crash_logger/${CMAKE_CFG_INTDIR}")
- list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/gstreamer010/${CMAKE_CFG_INTDIR}")
- list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/quicktime/${CMAKE_CFG_INTDIR}")
- list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/webkit/${CMAKE_CFG_INTDIR}")
+## list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/gstreamer010/${CMAKE_CFG_INTDIR}")
+## list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/quicktime/${CMAKE_CFG_INTDIR}")
+## list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/webkit/${CMAKE_CFG_INTDIR}")
set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-darwin.tar.bz2")
- set(VIEWER_EXE_GLOBS "'Second Life' SLPlugin mac-crash-logger")
+## set(VIEWER_EXE_GLOBS "'Second Life' SLPlugin mac-crash-logger")
+ set(VIEWER_EXE_GLOBS "'Second Life' mac-crash-logger")
set(VIEWER_LIB_GLOB "*.dylib")
endif (DARWIN)
if (LINUX)
list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/packaged")
set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-linux.tar.bz2")
- set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin SLPlugin")
+## set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin SLPlugin")
+ set(VIEWER_EXE_GLOBS "do-not-directly-run-secondlife-bin")
set(VIEWER_LIB_GLOB "*${CMAKE_SHARED_MODULE_SUFFIX}*")
set(VIEWER_COPY_MANIFEST copy_l_viewer_manifest)
endif (LINUX)
@@ -2198,7 +2211,7 @@ if (PACKAGE)
add_custom_target(generate_breakpad_symbols DEPENDS "${VIEWER_SYMBOL_FILE}")
add_dependencies(generate_breakpad_symbols "${VIEWER_BINARY_NAME}" "${VIEWER_COPY_MANIFEST}")
- add_dependencies(package generate_breakpad_symbols)
+ add_dependencies(llpackage generate_breakpad_symbols)
endif(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING)
endif (PACKAGE)
@@ -2376,11 +2389,6 @@ include(LLAddBuildTest)
SET(viewer_TEST_SOURCE_FILES
llagentaccess.cpp
llwlparammanager.cpp
- # Not *actually* a unit test, it's an integration test.
- # Because it won't work in the new unit test iface, i've commented out
- # and notified Nat. Delete this when it's replaced!
- # + poppy & brad 2009-06-05
- # llcapabilitylistener.cpp
)
set_source_files_properties(
${viewer_TEST_SOURCE_FILES}
diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt
index c6cff55cf7..c282746153 100644
--- a/indra/newview/VIEWER_VERSION.txt
+++ b/indra/newview/VIEWER_VERSION.txt
@@ -1 +1 @@
-3.7.21
+3.7.25
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index c2c93bbb80..0c5126574f 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -6171,7 +6171,7 @@
<key>Type</key>
<string>F32</string>
<key>Value</key>
- <real>30.0</real>
+ <real>600.0</real>
</map>
<key>MemoryPrivatePoolEnabled</key>
<map>
@@ -13523,6 +13523,28 @@
<key>Value</key>
<string>0</string>
</map>
+ <key>VivoxLogDirectory</key>
+ <map>
+ <key>Comment</key>
+ <string>Default log path is Application Support/SecondLife/logs specify alternate absolute path here.</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>String</string>
+ <key>Value</key>
+ <string></string>
+ </map>
+ <key>VivoxShutdownTimeout</key>
+ <map>
+ <key>Comment</key>
+ <string>shutdown timeout in miliseconds. The amount of time to wait for the service to shutdown gracefully after the last disconnect</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>String</string>
+ <key>Value</key>
+ <string>5</string>
+ </map>
<key>VivoxDebugSIPURIHostName</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl
index bc63d07d72..767fad016c 100755
--- a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl
@@ -40,4 +40,10 @@ mat4 getSkinnedTransform()
ret[3] = vec4(0,0,0,1);
return ret;
+
+#ifdef IS_AMD_CARD
+ // If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts.
+ vec4 dummy1 = matrixPalette[0];
+ vec4 dummy2 = matrixPalette[44];
+#endif
}
diff --git a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
index 57129c3bd1..6cd38d8ef5 100755
--- a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
@@ -63,5 +63,14 @@ mat4 getObjectSkinnedTransform()
ret[3] = vec4(trans, 1.0);
return ret;
+
+#ifdef IS_AMD_CARD
+ // If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts.
+ mat3 dummy1 = matrixPalette[0];
+ vec3 dummy2 = translationPalette[0];
+ mat3 dummy3 = matrixPalette[51];
+ vec3 dummy4 = translationPalette[51];
+#endif
+
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
index b40785bbd7..506118d381 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
@@ -111,10 +111,9 @@ void main()
#ifdef USE_INDEXED_TEX
passTextureIndex();
- vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
-#else
- vary_texcoord0 = texcoord0;
#endif
+
+ vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
vary_norm = norm;
vary_position = pos.xyz;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
index a4f54dff70..5264d6e1b4 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl
@@ -132,5 +132,11 @@ void main()
col.y *= col.y;
frag_color = col;
+
+#ifdef IS_AMD_CARD
+ // If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts.
+ vec3 dummy1 = kern[0];
+ vec3 dummy2 = kern[3];
+#endif
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
index 236567219b..1a464fec5d 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl
@@ -161,4 +161,12 @@ void main()
frag_color.rgb = out_col;
frag_color.a = 0.0;
+
+#ifdef IS_AMD_CARD
+ // If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts.
+ vec4 dummy1 = light[0];
+ vec4 dummy2 = light_col[0];
+ vec4 dummy3 = light[LIGHT_COUNT-1];
+ vec4 dummy4 = light_col[LIGHT_COUNT-1];
+#endif
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
index 0e6ab80d4d..c08e9d361a 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
@@ -127,13 +127,17 @@ vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
vec4 ret = texture2DLod(projectionMap, tc, lod);
ret.rgb = srgb_to_linear(ret.rgb);
- vec2 dist = tc-vec2(0.5);
+ vec2 dist = vec2(0.5) - abs(tc-vec2(0.5));
- float det = max(1.0-lod/(proj_lod*0.5), 0.0);
+ float det = min(lod/(proj_lod*0.5), 1.0);
- float d = dot(dist,dist);
-
- ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0);
+ float d = min(dist.x, dist.y);
+
+ d *= min(1, d * (proj_lod - lod));
+
+ float edge = 0.25*det;
+
+ ret *= clamp(d/edge, 0.0, 1.0);
return ret;
}
@@ -311,19 +315,17 @@ void main()
vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds;
vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0));
- stc /= stc.w;
+
if (stc.z > 0.0)
{
- float fatten = clamp(envIntensity*envIntensity+envIntensity*0.25, 0.25, 1.0);
-
- stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5);
+ stc /= stc.w;
if (stc.x < 1.0 &&
stc.y < 1.0 &&
stc.x > 0.0 &&
stc.y > 0.0)
{
- col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod).rgb*spec.rgb;
+ col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * envIntensity;
}
}
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl
index 96f9628424..018ced4cad 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postgiF.glsl
@@ -99,4 +99,10 @@ void main()
col = col*col*blur_quad.x + col*blur_quad.y + blur_quad.z;
frag_color.rgb = col;
+
+#ifdef IS_AMD_CARD
+ // If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts.
+ vec2 dummy1 = kern[0];
+ vec2 dummy2 = kern[31];
+#endif
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
index 8d8a6c9dde..f50635a139 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
@@ -130,15 +130,19 @@ vec4 correctWithGamma(vec4 col)
vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
- ret = correctWithGamma(ret);
+ ret.rgb = srgb_to_linear(ret.rgb);
- vec2 dist = tc-vec2(0.5);
+ vec2 dist = vec2(0.5) - abs(tc-vec2(0.5));
- float det = max(1.0-lod/(proj_lod*0.5), 0.0);
+ float det = min(lod/(proj_lod*0.5), 1.0);
- float d = dot(dist,dist);
-
- ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0);
+ float d = min(dist.x, dist.y);
+
+ d *= min(1, d * (proj_lod - lod));
+
+ float edge = 0.25*det;
+
+ ret *= clamp(d/edge, 0.0, 1.0);
return ret;
}
@@ -322,19 +326,14 @@ void main()
if (stc.z > 0.0)
{
- stc.xy /= stc.w;
-
- float fatten = clamp(envIntensity*envIntensity+envIntensity*0.5, 0.25, 1.0);
-
- //stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5);
- stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5);
+ stc /= stc.w;
if (stc.x < 1.0 &&
stc.y < 1.0 &&
stc.x > 0.0 &&
stc.y > 0.0)
{
- col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod-envIntensity*proj_lod).rgb*spec.rgb;
+ col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * envIntensity;
}
}
}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
index c20e00163c..94bd07bec6 100755
--- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
@@ -131,15 +131,19 @@ vec4 correctWithGamma(vec4 col)
vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
- ret = correctWithGamma(ret);
-
- vec2 dist = tc-vec2(0.5);
+ ret.rgb = srgb_to_linear(ret.rgb);
- float det = max(1.0-lod/(proj_lod*0.5), 0.0);
+ vec2 dist = vec2(0.5) - abs(tc-vec2(0.5));
- float d = dot(dist,dist);
-
- ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0);
+ float det = min(lod/(proj_lod*0.5), 1.0);
+
+ float d = min(dist.x, dist.y);
+
+ d *= min(1, d * (proj_lod - lod));
+
+ float edge = 0.25*det;
+
+ ret *= clamp(d/edge, 0.0, 1.0);
return ret;
}
@@ -334,25 +338,21 @@ void main()
vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds;
vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0));
- stc /= stc.w;
if (stc.z > 0.0)
{
- float fatten = clamp(envIntensity*envIntensity+envIntensity*0.25, 0.25, 1.0);
-
- stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5);
+ stc /= stc.w;
if (stc.x < 1.0 &&
stc.y < 1.0 &&
stc.x > 0.0 &&
stc.y > 0.0)
{
- col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod).rgb*shadow*spec.rgb;
+ col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * shadow * envIntensity;
}
}
}
}
-
//not sure why, but this line prevents MATBUG-194
col = max(col, vec3(0.0));
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
index 7689b72d20..92e1ac95a6 100755
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
@@ -131,15 +131,19 @@ vec4 correctWithGamma(vec4 col)
vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
- ret = correctWithGamma(ret);
+ ret.rgb = srgb_to_linear(ret.rgb);
- vec2 dist = tc-vec2(0.5);
+ vec2 dist = vec2(0.5) - abs(tc-vec2(0.5));
- float det = max(1.0-lod/(proj_lod*0.5), 0.0);
+ float det = min(lod/(proj_lod*0.5), 1.0);
- float d = dot(dist,dist);
-
- ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0);
+ float d = min(dist.x, dist.y);
+
+ d *= min(1, d * (proj_lod - lod));
+
+ float edge = 0.25*det;
+
+ ret *= clamp(d/edge, 0.0, 1.0);
return ret;
}
@@ -336,19 +340,14 @@ void main()
if (stc.z > 0.0)
{
- stc.xy /= stc.w;
-
- float fatten = clamp(envIntensity*envIntensity+envIntensity*0.5, 0.25, 1.0);
-
- //stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5);
- stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5);
+ stc /= stc.w;
if (stc.x < 1.0 &&
stc.y < 1.0 &&
stc.x > 0.0 &&
stc.y > 0.0)
{
- col += color.rgb*texture2DLodSpecular(projectionMap, stc.xy, proj_lod-envIntensity*proj_lod).rgb*shadow*spec.rgb;
+ col += color.rgb * texture2DLodSpecular(projectionMap, stc.xy, (1 - spec.a) * (proj_lod * 0.6)).rgb * shadow * envIntensity;
}
}
}
diff --git a/indra/newview/generate_breakpad_symbols.py b/indra/newview/generate_breakpad_symbols.py
index 4181e4ebb3..d351c406bc 100755
--- a/indra/newview/generate_breakpad_symbols.py
+++ b/indra/newview/generate_breakpad_symbols.py
@@ -31,7 +31,6 @@ $/LicenseInfo$
import collections
import fnmatch
import itertools
-import operator
import os
import re
import sys
@@ -149,7 +148,7 @@ def main(configuration, search_dirs, viewer_exes, libs_suffix, dump_syms_tool, v
== os.path.splitext(os.path.basename(m))[0].lower()
# there must be at least one .sym file in tarfile_members that matches
# each required module (ignoring file extensions)
- if not reduce(operator.or_, itertools.imap(match_module_basename, tarfile_members)):
+ if not any(itertools.imap(match_module_basename, tarfile_members)):
print >> sys.stderr, "failed to find required %s in generated %s" \
% (required_module, viewer_symbol_file)
os.remove(viewer_symbol_file)
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index e5a90e8a28..f151b15e29 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -408,10 +408,8 @@ LLAgent::LLAgent() :
mCurrentFidget(0),
mFirstLogin(FALSE),
mOutfitChosen(FALSE),
-
- mVoiceConnected(false),
- mAppearanceSerialNum(0),
+ mVoiceConnected(false),
mMouselookModeInSignal(NULL),
mMouselookModeOutSignal(NULL)
@@ -2260,8 +2258,6 @@ void LLAgent::heardChat(const LLUUID& id)
mChatTimer.reset();
}
-const F32 SIT_POINT_EXTENTS = 0.2f;
-
LLSD ll_sdmap_from_vector3(const LLVector3& vec)
{
LLSD ret;
@@ -3808,6 +3804,10 @@ void LLAgent::restartFailedTeleportRequest()
void LLAgent::clearTeleportRequest()
{
+ if(LLVoiceClient::instanceExists())
+ {
+ LLVoiceClient::getInstance()->setHidden(FALSE);
+ }
mTeleportRequest.reset();
}
@@ -3826,6 +3826,10 @@ bool LLAgent::hasPendingTeleportRequest()
void LLAgent::startTeleportRequest()
{
+ if(LLVoiceClient::instanceExists())
+ {
+ LLVoiceClient::getInstance()->setHidden(TRUE);
+ }
if (hasPendingTeleportRequest())
{
if (!isMaturityPreferenceSyncedWithServer())
@@ -3871,6 +3875,11 @@ void LLAgent::handleTeleportFinished()
void LLAgent::handleTeleportFailed()
{
+ if(LLVoiceClient::instanceExists())
+ {
+ LLVoiceClient::getInstance()->setHidden(FALSE);
+ }
+
if (mTeleportRequest != NULL)
{
mTeleportRequest->setStatus(LLTeleportRequest::kFailed);
@@ -4116,8 +4125,8 @@ void LLAgent::stopCurrentAnimations()
anim_it != gAgentAvatarp->mPlayingAnimations.end();
anim_it++)
{
- if (anim_it->first ==
- ANIM_AGENT_SIT_GROUND_CONSTRAINED)
+ if ((anim_it->first == ANIM_AGENT_DO_NOT_DISTURB)||
+ (anim_it->first == ANIM_AGENT_SIT_GROUND_CONSTRAINED))
{
// don't cancel a ground-sit anim, as viewers
// use this animation's status in
diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h
index a2e9cedd88..56bd1428ce 100755
--- a/indra/newview/llagent.h
+++ b/indra/newview/llagent.h
@@ -787,8 +787,7 @@ public:
private:
BOOL mShowAvatar; // Should we render the avatar?
- U32 mAppearanceSerialNum;
-
+
//--------------------------------------------------------------------
// Rendering state bitmap helpers
//--------------------------------------------------------------------
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp
index 2356a84688..291dffa210 100755
--- a/indra/newview/llagentcamera.cpp
+++ b/indra/newview/llagentcamera.cpp
@@ -885,7 +885,6 @@ void LLAgentCamera::cameraZoomIn(const F32 fraction)
}
- LLVector3d camera_offset(mCameraFocusOffsetTarget);
LLVector3d camera_offset_unit(mCameraFocusOffsetTarget);
F32 min_zoom = LAND_MIN_ZOOM;
F32 current_distance = (F32)camera_offset_unit.normalize();
@@ -957,7 +956,6 @@ void LLAgentCamera::cameraOrbitIn(const F32 meters)
}
else
{
- LLVector3d camera_offset(mCameraFocusOffsetTarget);
LLVector3d camera_offset_unit(mCameraFocusOffsetTarget);
F32 current_distance = (F32)camera_offset_unit.normalize();
F32 new_distance = current_distance - meters;
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index 49fedb8df8..f06ffb4fb3 100755
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -1009,6 +1009,10 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
continue;
}
+ // Don't care about this case - ordering of wearables with the same asset id has no effect.
+ // Causes the two-alphas error case in MAINT-4158.
+ // We should actually disallow wearing two wearables with the same asset id.
+#if 0
if (curr_wearable->getName() != new_item->getName() ||
curr_wearable->getItemID() != new_item->getUUID())
{
@@ -1019,6 +1023,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
mismatched++;
continue;
}
+#endif
// If we got here, everything matches.
matched++;
}
@@ -1083,7 +1088,6 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
if (isAgentAvatarValid())
{
gAgentAvatarp->setCompositeUpdatesEnabled(TRUE);
- gAgentAvatarp->updateVisualParams();
// If we have not yet declouded, we may want to use
// baked texture UUIDs sent from the first objectUpdate message
@@ -1101,6 +1105,12 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it
notifyLoadingFinished();
+ // Copy wearable params to avatar.
+ gAgentAvatarp->writeWearablesToAvatar();
+
+ // Then update the avatar based on the copied params.
+ gAgentAvatarp->updateVisualParams();
+
gAgentAvatarp->dumpAvatarTEs("setWearableOutfit");
LL_DEBUGS("Avatar") << "setWearableOutfit() end" << LL_ENDL;
@@ -1243,9 +1253,12 @@ void LLAgentWearables::userRemoveWearablesOfType(const LLWearableType::EType &ty
}
}
-// Combines userRemoveMulipleAttachments() and userAttachMultipleAttachments() logic to
-// get attachments into desired state with minimal number of adds/removes.
-void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array)
+// Given a desired set of attachments, find what objects need to be
+// removed, and what additional inventory items need to be added.
+void LLAgentWearables::findAttachmentsAddRemoveInfo(LLInventoryModel::item_array_t& obj_item_array,
+ llvo_vec_t& objects_to_remove,
+ llvo_vec_t& objects_to_retain,
+ LLInventoryModel::item_array_t& items_to_add)
{
// Possible cases:
// already wearing but not in request set -> take off.
@@ -1264,7 +1277,6 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj
}
// Build up list of objects to be removed and items currently attached.
- llvo_vec_t objects_to_remove;
for (LLVOAvatar::attachment_map_t::iterator iter = gAgentAvatarp->mAttachmentPoints.begin();
iter != gAgentAvatarp->mAttachmentPoints.end();)
{
@@ -1299,12 +1311,12 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj
{
// LL_INFOS() << "found object to keep, id " << objectp->getID() << ", item " << objectp->getAttachmentItemID() << LL_ENDL;
current_item_ids.insert(object_item_id);
+ objects_to_retain.push_back(objectp);
}
}
}
}
- LLInventoryModel::item_array_t items_to_add;
for (LLInventoryModel::item_array_t::iterator it = obj_item_array.begin();
it != obj_item_array.end();
++it)
@@ -1323,12 +1335,6 @@ void LLAgentWearables::userUpdateAttachments(LLInventoryModel::item_array_t& obj
// S32 remove_count = objects_to_remove.size();
// S32 add_count = items_to_add.size();
// LL_INFOS() << "remove " << remove_count << " add " << add_count << LL_ENDL;
-
- // Remove everything in objects_to_remove
- userRemoveMultipleAttachments(objects_to_remove);
-
- // Add everything in items_to_add
- userAttachMultipleAttachments(items_to_add);
}
void LLAgentWearables::userRemoveMultipleAttachments(llvo_vec_t& objects_to_remove)
@@ -1348,6 +1354,7 @@ void LLAgentWearables::userRemoveMultipleAttachments(llvo_vec_t& objects_to_remo
++it)
{
LLViewerObject *objectp = *it;
+ //gAgentAvatarp->resetJointPositionsOnDetach(objectp);
gMessageSystem->nextBlockFast(_PREHASH_ObjectData);
gMessageSystem->addU32Fast(_PREHASH_ObjectLocalID, objectp->getLocalID());
}
diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h
index cdb1bdbe05..1004482020 100755
--- a/indra/newview/llagentwearables.h
+++ b/indra/newview/llagentwearables.h
@@ -178,7 +178,10 @@ public:
typedef std::vector<LLViewerObject*> llvo_vec_t;
- static void userUpdateAttachments(LLInventoryModel::item_array_t& obj_item_array);
+ static void findAttachmentsAddRemoveInfo(LLInventoryModel::item_array_t& obj_item_array,
+ llvo_vec_t& objects_to_remove,
+ llvo_vec_t& objects_to_retain,
+ LLInventoryModel::item_array_t& items_to_add);
static void userRemoveMultipleAttachments(llvo_vec_t& llvo_array);
static void userAttachMultipleAttachments(LLInventoryModel::item_array_t& obj_item_array);
diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp
index 96de15bf75..9d887a61f1 100755
--- a/indra/newview/llaisapi.cpp
+++ b/indra/newview/llaisapi.cpp
@@ -34,6 +34,7 @@
#include "llsdutil.h"
#include "llviewerregion.h"
#include "llinventoryobserver.h"
+#include "llviewercontrol.h"
///----------------------------------------------------------------------------
/// Classes for AISv3 support.
diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm
index 988058aad3..549df80fa1 100644..100755
--- a/indra/newview/llappdelegate-objc.mm
+++ b/indra/newview/llappdelegate-objc.mm
@@ -84,6 +84,16 @@
callWindowUnfocus();
}
+- (void) applicationDidHide:(NSNotification *)notification
+{
+ callWindowHide();
+}
+
+- (void) applicationDidUnhide:(NSNotification *)notification
+{
+ callWindowUnhide();
+}
+
- (NSApplicationDelegateReply) applicationShouldTerminate:(NSApplication *)sender
{
if (!runMainLoop())
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 29534a4382..a64d5b50b3 100755
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -807,15 +807,48 @@ void LLWearableHoldingPattern::onAllComplete()
}
}
- // Update wearables.
- 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.size() << " attachments" << LL_ENDL;
- LLAgentWearables::userUpdateAttachments(mObjItems);
+ LLAgentWearables::llvo_vec_t objects_to_remove;
+ LLAgentWearables::llvo_vec_t objects_to_retain;
+ LLInventoryModel::item_array_t items_to_add;
+
+ LLAgentWearables::findAttachmentsAddRemoveInfo(mObjItems,
+ objects_to_remove,
+ objects_to_retain,
+ items_to_add);
+
+ LL_DEBUGS("Avatar") << self_av_string() << "Removing " << objects_to_remove.size()
+ << " attachments" << LL_ENDL;
+
+ // Here we remove the attachment pos overrides for *all*
+ // attachments, even those that are not being removed. This is
+ // needed to get joint positions all slammed down to their
+ // pre-attachment states.
+ gAgentAvatarp->clearAttachmentPosOverrides();
+
+ // Take off the attachments that will no longer be in the outfit.
+ LLAgentWearables::userRemoveMultipleAttachments(objects_to_remove);
+
+ // Update wearables.
+ LL_INFOS("Avatar") << self_av_string() << "HP " << index() << " updating agent wearables with "
+ << mResolved << " wearable items " << LL_ENDL;
+ LLAppearanceMgr::instance().updateAgentWearables(this);
+
+ // Restore attachment pos overrides for the attachments that
+ // are remaining in the outfit.
+ for (LLAgentWearables::llvo_vec_t::iterator it = objects_to_retain.begin();
+ it != objects_to_retain.end();
+ ++it)
+ {
+ LLViewerObject *objectp = *it;
+ gAgentAvatarp->addAttachmentPosOverridesForObject(objectp);
+ }
+
+ // Add new attachments to match those requested.
+ LL_DEBUGS("Avatar") << self_av_string() << "Adding " << items_to_add.size() << " attachments" << LL_ENDL;
+ LLAgentWearables::userAttachMultipleAttachments(items_to_add);
}
if (isFetchCompleted() && isMissingCompleted())
@@ -2699,7 +2732,12 @@ void LLAppearanceMgr::removeCOFItemLinks(const LLUUID& item_id, LLPointer<LLInve
const LLInventoryItem* item = item_array.at(i).get();
if (item->getIsLinkType() && item->getLinkedUUID() == item_id)
{
- remove_inventory_item(item->getUUID(), cb);
+ bool immediate_delete = false;
+ if (item->getType() == LLAssetType::AT_OBJECT)
+ {
+ immediate_delete = true;
+ }
+ remove_inventory_item(item->getUUID(), cb, immediate_delete);
}
}
}
@@ -3752,7 +3790,7 @@ bool LLAppearanceMgr::moveWearable(LLViewerInventoryItem* item, bool closer_to_b
//to cause appearance of the agent to be updated
bool result = false;
- if (result = gAgentWearables.moveWearable(item, closer_to_body))
+ if ((result = gAgentWearables.moveWearable(item, closer_to_body)))
{
gAgentAvatarp->wearableUpdated(item->getWearableType());
}
@@ -4056,17 +4094,33 @@ public:
bool handle(const LLSD& tokens, const LLSD& query_map,
LLMediaCtrl* web)
{
- LLPointer<LLInventoryCategory> category = new LLInventoryCategory(query_map["folder_id"],
- LLUUID::null,
- LLFolderType::FT_CLOTHING,
- "Quick Appearance");
- LLSD::UUID folder_uuid = query_map["folder_id"].asUUID();
- if ( gInventory.getCategory( folder_uuid ) != NULL )
- {
- LLAppearanceMgr::getInstance()->wearInventoryCategory(category, true, false);
+ LLSD::UUID folder_uuid;
- // *TODOw: This may not be necessary if initial outfit is chosen already -- josh
- gAgent.setOutfitChosen(TRUE);
+ if (folder_uuid.isNull() && query_map.has("folder_name"))
+ {
+ std::string outfit_folder_name = query_map["folder_name"];
+ folder_uuid = findDescendentCategoryIDByName(
+ gInventory.getLibraryRootFolderID(),
+ outfit_folder_name);
+ }
+ if (folder_uuid.isNull() && query_map.has("folder_id"))
+ {
+ folder_uuid = query_map["folder_id"].asUUID();
+ }
+
+ if (folder_uuid.notNull())
+ {
+ LLPointer<LLInventoryCategory> category = new LLInventoryCategory(folder_uuid,
+ LLUUID::null,
+ LLFolderType::FT_CLOTHING,
+ "Quick Appearance");
+ if ( gInventory.getCategory( folder_uuid ) != NULL )
+ {
+ LLAppearanceMgr::getInstance()->wearInventoryCategory(category, true, false);
+
+ // *TODOw: This may not be necessary if initial outfit is chosen already -- josh
+ gAgent.setOutfitChosen(TRUE);
+ }
}
// release avatar picker keyboard focus
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 4ad8181055..13f4e6ec63 100755
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -745,6 +745,15 @@ public:
}
};
+namespace {
+// With Xcode 6, _exit() is too magical to use with boost::bind(), so provide
+// this little helper function.
+void fast_exit(int rc)
+{
+ _exit(rc);
+}
+}
+
bool LLAppViewer::init()
{
setupErrorHandling(mSecondInstance);
@@ -801,10 +810,10 @@ bool LLAppViewer::init()
S32 rc(gSavedSettings.getS32("QAModeTermCode"));
if (rc >= 0)
{
- // QAModeTermCode set, terminate with that rc on LL_ERRS. Use _exit()
- // rather than exit() because normal cleanup depends too much on
- // successful startup!
- LLError::setFatalFunction(boost::bind(_exit, rc));
+ // QAModeTermCode set, terminate with that rc on LL_ERRS. Use
+ // fast_exit() rather than exit() because normal cleanup depends too
+ // much on successful startup!
+ LLError::setFatalFunction(boost::bind(fast_exit, rc));
}
mAlloc.setProfilingEnabled(gSavedSettings.getBOOL("MemProfiling"));
@@ -1679,19 +1688,12 @@ bool LLAppViewer::cleanup()
//dump scene loading monitor results
LLSceneMonitor::instance().dumpToFile(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "scene_monitor_results.csv"));
- if (LLFastTimerView::sAnalyzePerformance)
- {
- 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),
- gDirUtilp->getExpandedFilename(LL_PATH_LOGS, current_name),
- gDirUtilp->getExpandedFilename(LL_PATH_LOGS, report_name));
- }
- LLMetricPerformanceTesterBasic::cleanClass();
+ // There used to be an 'if (LLFastTimerView::sAnalyzePerformance)' block
+ // here, completely redundant with the one that occurs later in this same
+ // function. Presumably the duplication was due to an automated merge gone
+ // bad. Not knowing which instance to prefer, we chose to retain the later
+ // one because it happens just after mFastTimerLogThread is deleted. This
+ // comment is in case we guessed wrong, so we can move it here instead.
// remove any old breakpad minidump files from the log directory
if (! isError())
@@ -2036,7 +2038,7 @@ bool LLAppViewer::cleanup()
sImageDecodeThread = NULL;
delete mFastTimerLogThread;
mFastTimerLogThread = NULL;
-
+
if (LLFastTimerView::sAnalyzePerformance)
{
LL_INFOS() << "Analyzing performance" << LL_ENDL;
@@ -4896,7 +4898,10 @@ void LLAppViewer::idle()
// Handle the regular UI idle callbacks as well as
// hover callbacks
//
-
+
+#ifdef LL_DARWIN
+ if (!mQuitRequested) //MAINT-4243
+#endif
{
// LL_RECORD_BLOCK_TIME(FTM_IDLE_CB);
diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp
index c792eb8813..56154a2de3 100755
--- a/indra/newview/llappviewermacosx.cpp
+++ b/indra/newview/llappviewermacosx.cpp
@@ -63,16 +63,7 @@ namespace
int gArgC;
char** gArgV;
LLAppViewerMacOSX* gViewerAppPtr;
-#ifdef LL_CARBON_CRASH_HANDLER
- OSErr AEQuitHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn)
- {
- OSErr result = noErr;
-
- LLAppViewer::instance()->userQuit();
-
- return(result);
- }
-#endif
+
void (*gOldTerminateHandler)() = NULL;
}
diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp
index a98ff64d0a..e5c2d212fe 100755
--- a/indra/newview/llassetuploadresponders.cpp
+++ b/indra/newview/llassetuploadresponders.cpp
@@ -63,9 +63,6 @@
#include "llsdutil.h"
#include "llvfs.h"
-// When uploading multiple files, don't display any of them when uploading more than this number.
-static const S32 FILE_COUNT_DISPLAY_THRESHOLD = 5;
-
void dialog_refresh_all();
void on_new_single_inventory_upload_complete(
diff --git a/indra/newview/llblocklist.cpp b/indra/newview/llblocklist.cpp
index 1c68fabf8b..272a68bdf7 100755
--- a/indra/newview/llblocklist.cpp
+++ b/indra/newview/llblocklist.cpp
@@ -40,7 +40,6 @@ static const LLBlockListNameTypeComparator NAME_TYPE_COMPARATOR;
LLBlockList::LLBlockList(const Params& p)
: LLFlatListViewEx(p),
- mSelectedItem(NULL),
mDirty(true),
mShouldAddAll(true),
mActionType(NONE),
diff --git a/indra/newview/llblocklist.h b/indra/newview/llblocklist.h
index bac79f869e..0f7fa41c32 100755
--- a/indra/newview/llblocklist.h
+++ b/indra/newview/llblocklist.h
@@ -83,7 +83,6 @@ private:
LLHandle<LLToggleableMenu> mContextMenu;
- LLBlockedListItem* mSelectedItem;
std::string mNameFilter;
bool mDirty;
bool mShouldAddAll;
diff --git a/indra/newview/llchicletbar.cpp b/indra/newview/llchicletbar.cpp
index 28e367fbe1..d8b04f7004 100755
--- a/indra/newview/llchicletbar.cpp
+++ b/indra/newview/llchicletbar.cpp
@@ -35,16 +35,6 @@
namespace
{
const std::string& PANEL_CHICLET_NAME = "chiclet_list_panel";
-
- S32 get_curr_width(LLUICtrl* ctrl)
- {
- S32 cur_width = 0;
- if ( ctrl && ctrl->getVisible() )
- {
- cur_width = ctrl->getRect().getWidth();
- }
- return cur_width;
- }
}
LLChicletBar::LLChicletBar(const LLSD&)
diff --git a/indra/newview/llcommunicationchannel.cpp b/indra/newview/llcommunicationchannel.cpp
index 0821510645..cf98b56b4c 100755
--- a/indra/newview/llcommunicationchannel.cpp
+++ b/indra/newview/llcommunicationchannel.cpp
@@ -103,11 +103,11 @@ void LLCommunicationChannel::onDelete(LLNotificationPtr p)
void LLCommunicationChannel::onFilterFail(LLNotificationPtr pNotificationPtr)
{
std::string notificationType = pNotificationPtr->getType();
- if ((notificationType == "groupnotify")
+ if (((notificationType == "groupnotify")
|| (notificationType == "offer")
- || (notificationType == "notifytoast")
+ || (notificationType == "notifytoast"))
&& !pNotificationPtr->isCancelled())
{
- mHistory.insert(std::make_pair<LLDate, LLNotificationPtr>(pNotificationPtr->getDate(), pNotificationPtr));
+ mHistory.insert(history_list_t::value_type(pNotificationPtr->getDate(), pNotificationPtr));
}
}
diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h
index 56e1a26709..deff94ea16 100644
--- a/indra/newview/llconversationmodel.h
+++ b/indra/newview/llconversationmodel.h
@@ -213,7 +213,6 @@ private:
void onAvatarNameCache(const LLAvatarName& av_name); // callback used by fetchAvatarName
void updateName(const LLAvatarName& av_name);
- bool mIsMuted; // default is false
bool mIsModerator; // default is false
bool mDisplayModeratorLabel; // default is false
std::string mDisplayName;
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index c56006d9a3..3293b02131 100755
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -54,7 +54,6 @@
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 LLTrace::BlockTimerStatHandle FTM_CULL_REBOUND("Cull Rebound");
@@ -874,7 +873,7 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update)
}
pos -= camera.getOrigin();
- mDistanceWRTCamera = llround(pos.magVec(), 0.01f);
+ mDistanceWRTCamera = ll_round(pos.magVec(), 0.01f);
mVObjp->updateLOD();
}
}
diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp
index 5b151bdcda..f74164aea6 100755
--- a/indra/newview/lldrawpool.cpp
+++ b/indra/newview/lldrawpool.cpp
@@ -443,7 +443,7 @@ void LLRenderPass::pushMaskBatches(U32 type, U32 mask, BOOL texture, BOOL batch_
}
}
-void LLRenderPass::applyModelMatrix(LLDrawInfo& params)
+void LLRenderPass::applyModelMatrix(const LLDrawInfo& params)
{
if (params.mModelMatrix != gGLLastMatrix)
{
diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h
index 3bde0d29be..bc299cc89f 100755
--- a/indra/newview/lldrawpool.h
+++ b/indra/newview/lldrawpool.h
@@ -168,7 +168,7 @@ public:
BOOL isDead() { return FALSE; }
void resetDrawOrders() { }
- static void applyModelMatrix(LLDrawInfo& params);
+ static void applyModelMatrix(const LLDrawInfo& params);
virtual void pushBatches(U32 type, U32 mask, BOOL texture = TRUE, BOOL batch_textures = FALSE);
virtual void pushMaskBatches(U32 type, U32 mask, BOOL texture = TRUE, BOOL batch_textures = FALSE);
virtual void pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL batch_textures = FALSE);
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index 90e6dfe351..e1d3d1a905 100755
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -71,8 +71,6 @@ extern BOOL gUseGLPick;
F32 CLOTHING_GRAVITY_EFFECT = 0.7f;
F32 CLOTHING_ACCEL_FORCE_FACTOR = 0.2f;
-const S32 NUM_TEST_AVATARS = 30;
-const S32 MIN_PIXEL_AREA_2_PASS_SKINNING = 500000000;
// Format for gAGPVertices
// vertex format for bumpmapping:
@@ -375,7 +373,7 @@ void LLDrawPoolAvatar::endPostDeferredAlpha()
void LLDrawPoolAvatar::renderPostDeferred(S32 pass)
{
- const S32 actual_pass[] =
+ static const S32 actual_pass[] =
{ //map post deferred pass numbers to what render() expects
2, //skinned
4, // rigged fullbright
@@ -1626,7 +1624,8 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace*
{
F32 w = weight[j][k];
- idx[k] = llclamp((S32) floorf(w), 0, 63);
+ idx[k] = llclamp((S32) floorf(w), 0, JOINT_COUNT-1);
+
wght[k] = w - floorf(w);
scale += wght[k];
}
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index 67d1642639..33f7bc305c 100755
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -1329,7 +1329,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
for( i = minimum; i <= maximum; i++ )
{
F32 minus_one_to_one = F32(maximum - i) * twice_one_over_range - 1.f;
- bias_and_scale_lut[i] = llclampb(llround(127 * minus_one_to_one * ARTIFICIAL_SCALE + 128));
+ bias_and_scale_lut[i] = llclampb(ll_round(127 * minus_one_to_one * ARTIFICIAL_SCALE + 128));
}
}
else
@@ -1337,7 +1337,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
for( i = minimum; i <= maximum; i++ )
{
F32 minus_one_to_one = F32(i - minimum) * twice_one_over_range - 1.f;
- bias_and_scale_lut[i] = llclampb(llround(127 * minus_one_to_one * ARTIFICIAL_SCALE + 128));
+ bias_and_scale_lut[i] = llclampb(ll_round(127 * minus_one_to_one * ARTIFICIAL_SCALE + 128));
}
}
diff --git a/indra/newview/lldrawpoolmaterials.cpp b/indra/newview/lldrawpoolmaterials.cpp
index 514411aef5..f92320490a 100644
--- a/indra/newview/lldrawpoolmaterials.cpp
+++ b/indra/newview/lldrawpoolmaterials.cpp
@@ -96,7 +96,7 @@ void LLDrawPoolMaterials::endDeferredPass(S32 pass)
void LLDrawPoolMaterials::renderDeferred(S32 pass)
{
- U32 type_list[] =
+ static const U32 type_list[] =
{
LLRenderPass::PASS_MATERIAL,
//LLRenderPass::PASS_MATERIAL_ALPHA,
diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp
index 76c37439ab..4a059fdc67 100755
--- a/indra/newview/llfasttimerview.cpp
+++ b/indra/newview/llfasttimerview.cpp
@@ -219,7 +219,7 @@ 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)(mRecording.getNumRecordedPeriods() - MAX_VISIBLE_HISTORY));
+ mScrollIndex = ll_round( lerp * (F32)(mRecording.getNumRecordedPeriods() - MAX_VISIBLE_HISTORY));
mScrollIndex = llclamp( mScrollIndex, 0, (S32)mRecording.getNumRecordedPeriods());
return TRUE;
}
@@ -361,7 +361,6 @@ BOOL LLFastTimerView::handleScrollWheel(S32 x, S32 y, S32 clicks)
static BlockTimerStatHandle FTM_RENDER_TIMER("Timers");
static const S32 MARGIN = 10;
-static const S32 LEGEND_WIDTH = 220;
static std::vector<LLColor4> sTimerColors;
@@ -1136,7 +1135,7 @@ void LLFastTimerView::drawLineGraph()
max_time = llmax(F32Microseconds(1.f), F32Microseconds(cur_max));
}
- max_calls = llround(lerp((F32)max_calls, (F32) cur_max_calls, LLSmoothInterpolation::getInterpolant(0.1f)));
+ max_calls = ll_round(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;
@@ -1472,7 +1471,7 @@ void LLFastTimerView::drawBars()
LLRect frame_bar_rect;
frame_bar_rect.setLeftTopAndSize(mBarRect.mLeft,
bars_top,
- llround((mAverageTimerRow.mBars[0].mTotalTime / mTotalTimeDisplay) * mBarRect.getWidth()),
+ ll_round((mAverageTimerRow.mBars[0].mTotalTime / mTotalTimeDisplay) * mBarRect.getWidth()),
bar_height);
mAverageTimerRow.mTop = frame_bar_rect.mTop;
mAverageTimerRow.mBottom = frame_bar_rect.mBottom;
@@ -1486,7 +1485,7 @@ void LLFastTimerView::drawBars()
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());
+ + ll_round((row.mBars[0].mTotalTime / mTotalTimeDisplay) * mBarRect.getWidth());
drawBar(frame_bar_rect, row, image_width, image_height);
frame_bar_rect.translate(0, -(bar_height + vpad));
@@ -1617,8 +1616,8 @@ S32 LLFastTimerView::drawBar(LLRect bar_rect, TimerBarRow& row, S32 image_width,
}
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;
+ children_rect.mLeft = ll_round(timer_bar.mChildrenStart / mTotalTimeDisplay * (F32)mBarRect.getWidth()) + mBarRect.mLeft;
+ children_rect.mRight = ll_round(timer_bar.mChildrenEnd / mTotalTimeDisplay * (F32)mBarRect.getWidth()) + mBarRect.mLeft;
if (bar_rect.getHeight() > MIN_BAR_HEIGHT)
{
diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp
index 4db0422634..af84aea6a6 100755
--- a/indra/newview/llfeaturemanager.cpp
+++ b/indra/newview/llfeaturemanager.cpp
@@ -76,9 +76,8 @@ const char FEATURE_TABLE_FILENAME[] = "featuretable%s.txt";
const char FEATURE_TABLE_VER_FILENAME[] = "featuretable%s.%s.txt";
#endif
-const char GPU_TABLE_FILENAME[] = "gpu_table.txt";
-const char GPU_TABLE_VER_FILENAME[] = "gpu_table.%s.txt";
-
+#if 0 // consuming code in #if 0 below
+#endif
LLFeatureInfo::LLFeatureInfo(const std::string& name, const BOOL available, const F32 level)
: mValid(TRUE), mName(name), mAvailable(available), mRecommendedLevel(level)
{
@@ -428,6 +427,7 @@ bool LLFeatureManager::loadGPUClass()
{ //couldn't bench, use GLVersion
#if LL_DARWIN
//GLVersion is misleading on OSX, just default to class 3 if we can't bench
+ LL_WARNS() << "Unable to get an accurate benchmark; defaulting to class 3" << LL_ENDL;
mGPUClass = GPU_CLASS_3;
#else
if (gGLManager.mGLVersion < 2.f)
@@ -452,23 +452,31 @@ bool LLFeatureManager::loadGPUClass()
}
#endif
}
- else if (gbps < 5.f)
+ else if (gGLManager.mGLVersion <= 2.f)
+ {
+ mGPUClass = GPU_CLASS_0;
+ }
+ else if (gGLManager.mGLVersion <= 3.f)
+ {
+ mGPUClass = GPU_CLASS_1;
+ }
+ else if (gbps <= 5.f)
{
mGPUClass = GPU_CLASS_0;
}
- else if (gbps < 10.f)
+ else if (gbps <= 8.f)
{
mGPUClass = GPU_CLASS_1;
}
- else if (gbps < 20.f)
+ else if (gbps <= 16.f)
{
mGPUClass = GPU_CLASS_2;
}
- else if (gbps < 40.f)
+ else if (gbps <= 40.f)
{
mGPUClass = GPU_CLASS_3;
}
- else if (gbps < 80.f)
+ else if (gbps <= 80.f)
{
mGPUClass = GPU_CLASS_4;
}
@@ -476,195 +484,15 @@ bool LLFeatureManager::loadGPUClass()
{
mGPUClass = GPU_CLASS_5;
}
-
+
// defaults
mGPUString = gGLManager.getRawGLString();
mGPUSupported = TRUE;
-#if 0
- // first table is in the app dir
- std::string app_path = gDirUtilp->getAppRODataDir();
- app_path += gDirUtilp->getDirDelimiter();
- app_path += GPU_TABLE_FILENAME;
-
- // second table is downloaded with HTTP
- std::string http_filename = llformat(GPU_TABLE_VER_FILENAME, LLVersionInfo::getVersion().c_str());
- std::string http_path = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, http_filename);
-
- // use HTTP table if it exists
- std::string path;
- bool parse_ok = false;
- if (gDirUtilp->fileExists(http_path))
- {
- parse_ok = parseGPUTable(http_path);
- if (!parse_ok)
- {
- // the HTTP table failed to parse, so delete it
- LLFile::remove(http_path);
- LL_WARNS("RenderInit") << "Removed invalid gpu table '" << http_path << "'" << LL_ENDL;
- }
- }
-
- if (!parse_ok)
- {
- parse_ok = parseGPUTable(app_path);
- }
-#endif
- return true; // indicates that the file parsed correctly, not that the gpu was recognized
+ return true; // indicates that a gpu value was established
}
-bool LLFeatureManager::parseGPUTable(std::string filename)
-{
- llifstream file;
-
- LL_INFOS("RenderInit") << "Attempting to parse GPU table from " << filename << LL_ENDL;
- file.open(filename);
-
- if (file)
- {
- const char recognizer[] = "//GPU_TABLE";
- char first_line[MAX_STRING];
- file.getline(first_line, MAX_STRING);
- if (0 != strncmp(first_line, recognizer, strlen(recognizer)))
- {
- LL_WARNS("RenderInit") << "Invalid GPU table: " << filename << "!" << LL_ENDL;
- return false;
- }
- }
- else
- {
- LL_WARNS("RenderInit") << "Unable to open GPU table: " << filename << "!" << LL_ENDL;
- return false;
- }
-
- std::string rawRenderer = gGLManager.getRawGLString();
- std::string renderer = rawRenderer;
- for (std::string::iterator i = renderer.begin(); i != renderer.end(); ++i)
- {
- *i = tolower(*i);
- }
-
-#if LL_EXPORT_GPU_TABLE
- llofstream json;
- json.open("gpu_table.json");
-
- json << "var gpu_table = [" << std::endl;
-#endif
-
- bool gpuFound;
- U32 lineNumber;
- for (gpuFound = false, lineNumber = 0; !gpuFound && !file.eof(); lineNumber++)
- {
- char buffer[MAX_STRING]; /*Flawfinder: ignore*/
- buffer[0] = 0;
-
- file.getline(buffer, MAX_STRING);
-
- if (strlen(buffer) >= 2 && /*Flawfinder: ignore*/
- buffer[0] == '/' &&
- buffer[1] == '/')
- {
- // This is a comment.
- continue;
- }
-
- if (strlen(buffer) == 0) /*Flawfinder: ignore*/
- {
- // This is a blank line
- continue;
- }
-
- // setup the tokenizer
- std::string buf(buffer);
- std::string cls, label, expr, supported, stats_based, expected_gl_version;
- boost_tokenizer tokens(buf, boost::char_separator<char>("\t\n"));
- boost_tokenizer::iterator token_iter = tokens.begin();
-
- // grab the label, pseudo regular expression, and class
- if(token_iter != tokens.end())
- {
- label = *token_iter++;
- }
- if(token_iter != tokens.end())
- {
- expr = *token_iter++;
- }
- if(token_iter != tokens.end())
- {
- cls = *token_iter++;
- }
- if(token_iter != tokens.end())
- {
- supported = *token_iter++;
- }
- if (token_iter != tokens.end())
- {
- stats_based = *token_iter++;
- }
- if (token_iter != tokens.end())
- {
- expected_gl_version = *token_iter++;
- }
-
- if (label.empty() || expr.empty() || cls.empty() || supported.empty())
- {
- LL_WARNS("RenderInit") << "invald gpu_table.txt:" << lineNumber << ": '" << buffer << "'" << LL_ENDL;
- continue;
- }
-#if LL_EXPORT_GPU_TABLE
- json << "{'label' : '" << label << "',\n" <<
- "'regexp' : '" << expr << "',\n" <<
- "'class' : '" << cls << "',\n" <<
- "'supported' : '" << supported << "',\n" <<
- "'stats_based' : " << stats_based << ",\n" <<
- "'gl_version' : " << expected_gl_version << "\n},\n";
-#endif
-
- for (U32 i = 0; i < expr.length(); i++) /*Flawfinder: ignore*/
- {
- expr[i] = tolower(expr[i]);
- }
-
- // run the regular expression against the renderer
- boost::regex re(expr.c_str());
- if(boost::regex_search(renderer, re))
- {
- // if we found it, stop!
-#if !LL_EXPORT_GPU_TABLE
- gpuFound = true;
-#endif
- mGPUString = label;
- mGPUClass = (EGPUClass) strtol(cls.c_str(), NULL, 10);
- mGPUSupported = (BOOL) strtol(supported.c_str(), NULL, 10);
- sscanf(expected_gl_version.c_str(), "%f", &mExpectedGLVersion);
- }
- }
-#if LL_EXPORT_GPU_TABLE
- json << "];\n\n";
- json.close();
-#endif
- file.close();
-
- if ( gpuFound )
- {
- LL_INFOS("RenderInit") << "GPU '" << rawRenderer << "' recognized as '" << mGPUString << "'" << LL_ENDL;
- if (!mGPUSupported)
- {
- LL_INFOS("RenderInit") << "GPU '" << mGPUString << "' is not supported." << LL_ENDL;
- }
- }
- else
- {
- LL_WARNS("RenderInit") << "GPU '" << rawRenderer << "' not recognized" << LL_ENDL;
- }
-
-#if LL_DARWIN // never go over "Mid" settings by default on OS X
- mGPUClass = llmin(mGPUClass, GPU_CLASS_2);
-#endif
- return true;
-}
-
// responder saves table into file
class LLHTTPFeatureTableResponder : public LLHTTPClient::Responder
{
@@ -745,26 +573,11 @@ void fetch_feature_table(std::string table)
LLHTTPClient::get(url, new LLHTTPFeatureTableResponder(path));
}
-void fetch_gpu_table(std::string table)
-{
- const std::string base = gSavedSettings.getString("FeatureManagerHTTPTable");
-
- const std::string filename = llformat(table.c_str(), LLVersionInfo::getVersion().c_str());
-
- const std::string url = base + "/" + filename;
-
- const std::string path = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, filename);
-
- LL_INFOS() << "LLFeatureManager fetching " << url << " into " << path << LL_ENDL;
-
- LLHTTPClient::get(url, new LLHTTPFeatureTableResponder(path));
-}
// fetch table(s) from a website (S3)
void LLFeatureManager::fetchHTTPTables()
{
fetch_feature_table(FEATURE_TABLE_VER_FILENAME);
- fetch_gpu_table(GPU_TABLE_VER_FILENAME);
}
diff --git a/indra/newview/llfeaturemanager.h b/indra/newview/llfeaturemanager.h
index 95141b241d..69078ccc21 100755
--- a/indra/newview/llfeaturemanager.h
+++ b/indra/newview/llfeaturemanager.h
@@ -162,9 +162,6 @@ protected:
bool parseFeatureTable(std::string filename);
///< @returns TRUE is file parsed correctly, FALSE if not
- bool parseGPUTable(std::string filename);
- ///< @returns true if file parsed correctly, false if not - does not reflect whether or not the gpu was recognized
-
void initBaseMask();
diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp
index 5debf71744..ef50594feb 100755
--- a/indra/newview/llfilepicker.cpp
+++ b/indra/newview/llfilepicker.cpp
@@ -600,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;
@@ -702,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 = "\?\?\?\?";
@@ -1100,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",
@@ -1293,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;
diff --git a/indra/newview/llfilepicker.h b/indra/newview/llfilepicker.h
index 0e0cec3943..b6e67375cd 100755
--- a/indra/newview/llfilepicker.h
+++ b/indra/newview/llfilepicker.h
@@ -164,11 +164,9 @@ private:
#if LL_DARWIN
S32 mPickOptions;
std::vector<std::string> mFileVector;
- UInt32 mFileIndex;
bool doNavChooseDialog(ELoadFilter filter);
bool doNavSaveDialog(ESaveFilter filter, const std::string& filename);
- //static Boolean navOpenFilterProc(AEDesc *theItem, void *info, void *callBackUD, NavFilterModes filterMode);
std::vector<std::string>* navOpenFilterProc(ELoadFilter filter);
#endif
diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp
index b64034b945..b6e61f83b1 100755
--- a/indra/newview/llflexibleobject.cpp
+++ b/indra/newview/llflexibleobject.cpp
@@ -308,7 +308,7 @@ void LLVolumeImplFlexible::updateRenderRes()
mRenderRes = (S32) (12.f*app_angle);
#else //legacy behavior
//number of segments only cares about z axis
- F32 app_angle = llround((F32) atan2( mVO->getScale().mV[2]*2.f, drawablep->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f);
+ F32 app_angle = ll_round((F32) atan2( mVO->getScale().mV[2]*2.f, drawablep->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f);
// Rendering sections increases with visible angle on the screen
mRenderRes = (S32)(FLEXIBLE_OBJECT_MAX_SECTIONS*4*app_angle*DEG_TO_RAD/LLViewerCamera::getInstance()->getView());
diff --git a/indra/newview/llflickrconnect.cpp b/indra/newview/llflickrconnect.cpp
index b715896264..b75660ea00 100644
--- a/indra/newview/llflickrconnect.cpp
+++ b/indra/newview/llflickrconnect.cpp
@@ -400,7 +400,7 @@ void LLFlickrConnect::uploadPhoto(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;
}
diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp
index 66149a4367..7ac3ac2f61 100755
--- a/indra/newview/llfloaterabout.cpp
+++ b/indra/newview/llfloaterabout.cpp
@@ -123,18 +123,17 @@ BOOL LLFloaterAbout::postBuild()
LLViewerTextEditor *support_widget =
getChild<LLViewerTextEditor>("support_editor", true);
- LLViewerTextEditor *linden_names_widget =
- getChild<LLViewerTextEditor>("linden_names", true);
-
LLViewerTextEditor *contrib_names_widget =
getChild<LLViewerTextEditor>("contrib_names", true);
- LLViewerTextEditor *trans_names_widget =
- getChild<LLViewerTextEditor>("trans_names", true);
+ LLViewerTextEditor *licenses_widget =
+ getChild<LLViewerTextEditor>("licenses_editor", true);
getChild<LLUICtrl>("copy_btn")->setCommitCallback(
boost::bind(&LLFloaterAbout::onClickCopyToClipboard, this));
+ static const LLUIColor about_color = LLUIColorTable::instance().getColor("TextFgReadOnlyColor");
+
if (gAgent.getRegion())
{
// start fetching server release notes URL
@@ -153,24 +152,6 @@ BOOL LLFloaterAbout::postBuild()
support_widget->setEnabled(FALSE);
support_widget->startOfDoc();
- // Get the names of Lindens, added by viewer_manifest.py at build time
- std::string lindens_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"lindens.txt");
- llifstream linden_file;
- std::string lindens;
- linden_file.open(lindens_path); /* Flawfinder: ignore */
- if (linden_file.is_open())
- {
- std::getline(linden_file, lindens); // all names are on a single line
- linden_file.close();
- linden_names_widget->setText(lindens);
- }
- else
- {
- LL_INFOS("AboutInit") << "Could not read lindens file at " << lindens_path << LL_ENDL;
- }
- linden_names_widget->setEnabled(FALSE);
- linden_names_widget->startOfDoc();
-
// Get the names of contributors, extracted from .../doc/contributions.txt by viewer_manifest.py at build time
std::string contributors_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"contributors.txt");
llifstream contrib_file;
@@ -189,23 +170,28 @@ BOOL LLFloaterAbout::postBuild()
contrib_names_widget->setEnabled(FALSE);
contrib_names_widget->startOfDoc();
- // Get the names of translators, extracted from .../doc/tranlations.txt by viewer_manifest.py at build time
- std::string translators_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"translators.txt");
- llifstream trans_file;
- std::string translators;
- trans_file.open(translators_path); /* Flawfinder: ignore */
- if (trans_file.is_open())
+ // Get the Versions and Copyrights, created at build time
+ std::string licenses_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"packages-info.txt");
+ llifstream licenses_file;
+ licenses_file.open(licenses_path); /* Flawfinder: ignore */
+ if (licenses_file.is_open())
{
- std::getline(trans_file, translators); // all names are on a single line
- trans_file.close();
+ std::string license_line;
+ licenses_widget->clear();
+ while ( std::getline(licenses_file, license_line) )
+ {
+ licenses_widget->appendText(license_line+"\n", FALSE,
+ LLStyle::Params() .color(about_color));
+ }
+ licenses_file.close();
}
else
{
- LL_WARNS("AboutInit") << "Could not read translators file at " << translators_path << LL_ENDL;
+ // this case will use the (out of date) hard coded value from the XUI
+ LL_INFOS("AboutInit") << "Could not read licenses file at " << licenses_path << LL_ENDL;
}
- trans_names_widget->setText(translators);
- trans_names_widget->setEnabled(FALSE);
- trans_names_widget->startOfDoc();
+ licenses_widget->setEnabled(FALSE);
+ licenses_widget->startOfDoc();
return TRUE;
}
diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp
index 060c091737..0a0e5ffc06 100755
--- a/indra/newview/llfloaterbuyland.cpp
+++ b/indra/newview/llfloaterbuyland.cpp
@@ -65,9 +65,6 @@
// NOTE: This is duplicated in lldatamoney.cpp ...
const F32 GROUP_LAND_BONUS_FACTOR = 1.1f;
-const F64 CURRENCY_ESTIMATE_FREQUENCY = 0.5;
- // how long of a pause in typing a currency buy amount before an
- // estimate is fetched from the server
class LLFloaterBuyLandUI
: public LLFloater
@@ -392,9 +389,9 @@ void LLFloaterBuyLandUI::updateParcelInfo()
}
mParcelBillableArea =
- llround(mRegion->getBillableFactor() * mParcelActualArea);
+ ll_round(mRegion->getBillableFactor() * mParcelActualArea);
- mParcelSupportedObjects = llround(
+ mParcelSupportedObjects = ll_round(
parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus());
// Can't have more than region max tasks, regardless of parcel
// object bonus factor.
diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp
index d0939b3eee..6a82b8c74c 100755
--- a/indra/newview/llfloatercamera.cpp
+++ b/indra/newview/llfloatercamera.cpp
@@ -47,9 +47,7 @@ static LLDefaultChildRegistry::Register<LLPanelCameraItem> r("panel_camera_item"
const F32 NUDGE_TIME = 0.25f; // in seconds
const F32 ORBIT_NUDGE_RATE = 0.05f; // fraction of normal speed
-// Constants
-const F32 CAMERA_BUTTON_DELAY = 0.0f;
-
+// constants
#define ORBIT "cam_rotate_stick"
#define PAN "cam_track_stick"
#define ZOOM "zoom"
diff --git a/indra/newview/llfloaterfacebook.cpp b/indra/newview/llfloaterfacebook.cpp
index 6888e076aa..3a2047cfef 100644
--- a/indra/newview/llfloaterfacebook.cpp
+++ b/indra/newview/llfloaterfacebook.cpp
@@ -59,7 +59,6 @@ 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/";
const std::string DEFAULT_CHECKIN_ICON_URL = "http://map.secondlife.com.s3.amazonaws.com/map_placeholder.png";
const std::string DEFAULT_CHECKIN_QUERY_PARAMETERS = "?sourceid=slshare_checkin&utm_source=facebook&utm_medium=checkin&utm_campaign=slshare";
diff --git a/indra/newview/llfloaterflickr.cpp b/indra/newview/llfloaterflickr.cpp
index 36afab86b7..51352e083a 100644
--- a/indra/newview/llfloaterflickr.cpp
+++ b/indra/newview/llfloaterflickr.cpp
@@ -55,7 +55,6 @@
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";
diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp
index 6966ca5639..37774fbc5c 100755
--- a/indra/newview/llfloatergodtools.cpp
+++ b/indra/newview/llfloatergodtools.cpp
@@ -401,14 +401,9 @@ void LLFloaterGodTools::sendGodUpdateRegionInfo()
// Floats because spinners only support floats. JC
const F32 BILLABLE_FACTOR_DEFAULT = 1;
-const F32 BILLABLE_FACTOR_MIN = 0.0f;
-const F32 BILLABLE_FACTOR_MAX = 4.f;
// floats because spinners only understand floats. JC
const F32 PRICE_PER_METER_DEFAULT = 1.f;
-const F32 PRICE_PER_METER_MIN = 0.f;
-const F32 PRICE_PER_METER_MAX = 100.f;
-
LLPanelRegionTools::LLPanelRegionTools()
: LLPanel()
@@ -833,9 +828,6 @@ void LLPanelRegionTools::onSelectRegion()
// ^ ^ ^
// LEFT R2 RIGHT
-const F32 HOURS_TO_RADIANS = (2.f*F_PI)/24.f;
-
-
LLPanelGridTools::LLPanelGridTools() :
LLPanel()
{
diff --git a/indra/newview/llfloatergroupbulkban.cpp b/indra/newview/llfloatergroupbulkban.cpp
index 54a2283b13..44074047a7 100644
--- a/indra/newview/llfloatergroupbulkban.cpp
+++ b/indra/newview/llfloatergroupbulkban.cpp
@@ -101,7 +101,7 @@ void LLFloaterGroupBulkBan::showForGroup(const LLUUID& group_id, uuid_vec_t* age
// 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/llfloaterimsession.cpp b/indra/newview/llfloaterimsession.cpp
index 9def253ba5..fc7fcf3ab9 100755
--- a/indra/newview/llfloaterimsession.cpp
+++ b/indra/newview/llfloaterimsession.cpp
@@ -396,7 +396,7 @@ bool LLFloaterIMSession::canAddSelectedToChat(const uuid_vec_t& uuids)
{
if (!mSession
|| mDialog == IM_SESSION_GROUP_START
- || mDialog == IM_SESSION_INVITE && gAgent.isInGroup(mSessionID))
+ || (mDialog == IM_SESSION_INVITE && gAgent.isInGroup(mSessionID)))
{
return false;
}
@@ -779,7 +779,7 @@ bool LLFloaterIMSession::toggle(const LLUUID& session_id)
floater->setVisible(false);
return false;
}
- else if(floater && (!floater->isDocked() || floater->getVisible() && !floater->hasFocus()))
+ else if(floater && ((!floater->isDocked() || floater->getVisible()) && !floater->hasFocus()))
{
floater->setVisible(TRUE);
floater->setFocus(TRUE);
diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp
index fbdaca0e6f..2864f018b2 100755
--- a/indra/newview/llfloaterimsessiontab.cpp
+++ b/indra/newview/llfloaterimsessiontab.cpp
@@ -47,7 +47,7 @@
const F32 REFRESH_INTERVAL = 1.0f;
LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id)
-: LLTransientDockableFloater(NULL, true, session_id),
+: LLTransientDockableFloater(NULL, false, session_id),
mIsP2PChat(false),
mExpandCollapseBtn(NULL),
mTearOffBtn(NULL),
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index 7621c35ed2..8c4feff1d9 100755
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -1224,7 +1224,7 @@ void LLPanelLandObjects::refresh()
{
S32 sw_max = parcel->getSimWideMaxPrimCapacity();
S32 sw_total = parcel->getSimWidePrimCount();
- S32 max = llround(parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus());
+ S32 max = ll_round(parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus());
S32 total = parcel->getPrimCount();
S32 owned = parcel->getOwnerPrimCount();
S32 group = parcel->getGroupPrimCount();
@@ -2049,9 +2049,9 @@ void LLPanelLandOptions::refresh()
else
{
mLocationText->setTextArg("[LANDING]",llformat("%d, %d, %d (%d\xC2\xB0)",
- llround(pos.mV[VX]),
- llround(pos.mV[VY]),
- llround(pos.mV[VZ]),
+ ll_round(pos.mV[VX]),
+ ll_round(pos.mV[VY]),
+ ll_round(pos.mV[VZ]),
user_look_at_angle));
}
diff --git a/indra/newview/llfloaterlandholdings.cpp b/indra/newview/llfloaterlandholdings.cpp
index cf03087afb..f34760a6bf 100755
--- a/indra/newview/llfloaterlandholdings.cpp
+++ b/indra/newview/llfloaterlandholdings.cpp
@@ -208,8 +208,8 @@ void LLFloaterLandHoldings::processPlacesReply(LLMessageSystem* msg, void**)
self->mActualArea += actual_area;
self->mBillableArea += billable_area;
- S32 region_x = llround(global_x) % REGION_WIDTH_UNITS;
- S32 region_y = llround(global_y) % REGION_WIDTH_UNITS;
+ S32 region_x = ll_round(global_x) % REGION_WIDTH_UNITS;
+ S32 region_y = ll_round(global_y) % REGION_WIDTH_UNITS;
std::string location;
location = llformat("%s (%d, %d)", sim_name.c_str(), region_x, region_y);
diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp
index 473e2938be..333ff863e5 100755
--- a/indra/newview/llfloatermap.cpp
+++ b/indra/newview/llfloatermap.cpp
@@ -52,10 +52,7 @@
// The minor cardinal direction labels are hidden if their height is more
// than this proportion of the map.
const F32 MAP_MINOR_DIR_THRESHOLD = 0.07f;
-const S32 MAP_PADDING_LEFT = 0;
-const S32 MAP_PADDING_TOP = 2;
-const S32 MAP_PADDING_RIGHT = 2;
-const S32 MAP_PADDING_BOTTOM = 0;
+
//
// Member functions
//
@@ -156,8 +153,8 @@ void LLFloaterMap::setDirectionPos( LLTextBox* text_box, F32 rotation )
radius -= 8.f;
text_box->setOrigin(
- llround(map_half_width - text_half_width + radius * cos( rotation )),
- llround(map_half_height - text_half_height + radius * sin( rotation )) );
+ ll_round(map_half_width - text_half_width + radius * cos( rotation )),
+ ll_round(map_half_height - text_half_height + radius * sin( rotation )) );
}
void LLFloaterMap::updateMinorDirections()
diff --git a/indra/newview/llfloatermediasettings.cpp b/indra/newview/llfloatermediasettings.cpp
index 4f2a6ec1b7..4fd5c0587a 100755
--- a/indra/newview/llfloatermediasettings.cpp
+++ b/indra/newview/llfloatermediasettings.cpp
@@ -47,7 +47,6 @@ LLFloaterMediaSettings::LLFloaterMediaSettings(const LLSD& key)
mPanelMediaSettingsGeneral(NULL),
mPanelMediaSettingsSecurity(NULL),
mPanelMediaSettingsPermissions(NULL),
- mWaitingToClose( false ),
mIdenticalHasMediaInfo( true ),
mMultipleMedia(false),
mMultipleValidMedia(false)
diff --git a/indra/newview/llfloatermediasettings.h b/indra/newview/llfloatermediasettings.h
index 1d25530986..f93512eb3a 100755
--- a/indra/newview/llfloatermediasettings.h
+++ b/indra/newview/llfloatermediasettings.h
@@ -83,7 +83,6 @@ private:
bool haveValuesChanged() const;
LLSD mInitialValues;
- bool mWaitingToClose;
};
#endif // LL_LLFLOATERMEDIASETTINGS_H
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index b17ce97a2e..ec905558aa 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -121,12 +121,6 @@ S32 LLFloaterModelPreview::sUploadAmount = 10;
LLFloaterModelPreview* LLFloaterModelPreview::sInstance = NULL;
std::list<LLModelLoader*> LLModelLoader::sActiveLoaderList;
-const S32 PREVIEW_BORDER_WIDTH = 2;
-const S32 PREVIEW_RESIZE_HANDLE_SIZE = S32(RESIZE_HANDLE_WIDTH * OO_SQRT2) + PREVIEW_BORDER_WIDTH;
-const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE;
-const S32 PREF_BUTTON_HEIGHT = 16 + 7 + 16;
-const S32 PREVIEW_TEXTURE_HEIGHT = 300;
-
// "Retain%" decomp parameter has values from 0.0 to 1.0 by 0.01
// But according to the UI spec for upload model floater, this parameter
// should be represented by Retain spinner with values from 1 to 100 by 1.
@@ -1935,7 +1929,9 @@ bool LLModelLoader::doLoadModel()
LLJoint* pJoint = mPreview->getPreviewAvatar()->getJoint( lookingForJoint );
if ( pJoint )
{
- pJoint->storeCurrentXform( jointTransform.getTranslation() );
+ LLUUID fake_mesh_id;
+ fake_mesh_id.generate();
+ pJoint->addAttachmentPosOverride( jointTransform.getTranslation(), fake_mesh_id, gAgentAvatarp->avString());
}
else
{
@@ -3242,7 +3238,11 @@ U32 LLModelPreview::calcResourceCost()
if ( mFMP && mFMP->childGetValue("upload_joints").asBoolean() )
{
- getPreviewAvatar()->setPelvisOffset( mPelvisZOffset );
+ // FIXME if preview avatar ever gets reused, this fake mesh ID stuff will fail.
+ // see also call to addAttachmentPosOverride.
+ LLUUID fake_mesh_id;
+ fake_mesh_id.generate();
+ getPreviewAvatar()->addPelvisFixup( mPelvisZOffset, fake_mesh_id );
}
F32 streaming_cost = 0.f;
diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp
index ee7f413a59..0cca715fe2 100755
--- a/indra/newview/llfloaternamedesc.cpp
+++ b/indra/newview/llfloaternamedesc.cpp
@@ -52,14 +52,9 @@
#include "llinventorytype.h"
const S32 PREVIEW_LINE_HEIGHT = 19;
-const S32 PREVIEW_CLOSE_BOX_SIZE = 16;
const S32 PREVIEW_BORDER_WIDTH = 2;
const S32 PREVIEW_RESIZE_HANDLE_SIZE = S32(RESIZE_HANDLE_WIDTH * OO_SQRT2) + PREVIEW_BORDER_WIDTH;
-const S32 PREVIEW_VPAD = 2;
const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE;
-const S32 PREVIEW_HEADER_SIZE = 3 * PREVIEW_LINE_HEIGHT + PREVIEW_VPAD;
-const S32 PREF_BUTTON_WIDTH = 64;
-const S32 PREF_BUTTON_HEIGHT = 16;
//-----------------------------------------------------------------------------
// LLFloaterNameDesc()
diff --git a/indra/newview/llfloateropenobject.cpp b/indra/newview/llfloateropenobject.cpp
index 9986bdbd7f..ef746d308d 100755
--- a/indra/newview/llfloateropenobject.cpp
+++ b/indra/newview/llfloateropenobject.cpp
@@ -58,6 +58,8 @@ LLFloaterOpenObject::LLFloaterOpenObject(const LLSD& key)
{
mCommitCallbackRegistrar.add("OpenObject.MoveToInventory", boost::bind(&LLFloaterOpenObject::onClickMoveToInventory, this));
mCommitCallbackRegistrar.add("OpenObject.MoveAndWear", boost::bind(&LLFloaterOpenObject::onClickMoveAndWear, this));
+ mCommitCallbackRegistrar.add("OpenObject.ReplaceOutfit", boost::bind(&LLFloaterOpenObject::onClickReplace, this));
+ mCommitCallbackRegistrar.add("OpenObject.Cancel", boost::bind(&LLFloaterOpenObject::onClickCancel, this));
}
LLFloaterOpenObject::~LLFloaterOpenObject()
@@ -115,6 +117,7 @@ void LLFloaterOpenObject::refresh()
getChild<LLUICtrl>("object_name")->setTextArg("[DESC]", name);
getChildView("copy_to_inventory_button")->setEnabled(enabled);
getChildView("copy_and_wear_button")->setEnabled(enabled);
+ getChildView("copy_and_replace_button")->setEnabled(enabled);
}
@@ -135,7 +138,7 @@ void LLFloaterOpenObject::dirty()
-void LLFloaterOpenObject::moveToInventory(bool wear)
+void LLFloaterOpenObject::moveToInventory(bool wear, bool replace)
{
if (mObjectSelection->getRootObjectCount() != 1)
{
@@ -163,7 +166,7 @@ void LLFloaterOpenObject::moveToInventory(bool wear)
parent_category_id = gInventory.getRootFolderID();
}
- inventory_func_type func = boost::bind(LLFloaterOpenObject::callbackCreateInventoryCategory,_1,object_id,wear);
+ inventory_func_type func = boost::bind(LLFloaterOpenObject::callbackCreateInventoryCategory,_1,object_id,wear,replace);
LLUUID category_id = gInventory.createNewCategory(parent_category_id,
LLFolderType::FT_NONE,
name,
@@ -177,6 +180,7 @@ void LLFloaterOpenObject::moveToInventory(bool wear)
data->mCatID = category_id;
data->mWear = wear;
data->mFolderResponded = false;
+ data->mReplace = replace;
// Copy and/or move the items into the newly created folder.
// Ignore any "you're going to break this item" messages.
@@ -194,13 +198,14 @@ void LLFloaterOpenObject::moveToInventory(bool wear)
}
// static
-void LLFloaterOpenObject::callbackCreateInventoryCategory(const LLUUID& category_id, LLUUID object_id, bool wear)
+void LLFloaterOpenObject::callbackCreateInventoryCategory(const LLUUID& category_id, LLUUID object_id, bool wear, bool replace)
{
LLCatAndWear* wear_data = new LLCatAndWear;
wear_data->mCatID = category_id;
wear_data->mWear = wear;
wear_data->mFolderResponded = true;
+ wear_data->mReplace = replace;
// Copy and/or move the items into the newly created folder.
// Ignore any "you're going to break this item" messages.
@@ -241,7 +246,17 @@ void LLFloaterOpenObject::onClickMoveToInventory()
void LLFloaterOpenObject::onClickMoveAndWear()
{
- moveToInventory(true);
+ moveToInventory(true, false);
closeFloater();
}
+void LLFloaterOpenObject::onClickReplace()
+{
+ moveToInventory(true, true);
+ closeFloater();
+}
+
+void LLFloaterOpenObject::onClickCancel()
+{
+ closeFloater();
+}
diff --git a/indra/newview/llfloateropenobject.h b/indra/newview/llfloateropenobject.h
index 8e472804a4..2e761f99bf 100755
--- a/indra/newview/llfloateropenobject.h
+++ b/indra/newview/llfloateropenobject.h
@@ -50,6 +50,7 @@ public:
LLUUID mCatID;
bool mWear;
bool mFolderResponded;
+ bool mReplace;
};
protected:
@@ -59,11 +60,13 @@ protected:
void draw();
virtual void onOpen(const LLSD& key);
- void moveToInventory(bool wear);
+ void moveToInventory(bool wear, bool replace = false);
void onClickMoveToInventory();
void onClickMoveAndWear();
- static void callbackCreateInventoryCategory(const LLUUID& category_id, LLUUID object_id, bool wear);
+ void onClickReplace();
+ void onClickCancel();
+ static void callbackCreateInventoryCategory(const LLUUID& category_id, LLUUID object_id, bool wear, bool replace = false);
static void callbackMoveInventory(S32 result, void* data);
private:
diff --git a/indra/newview/llfloaterpathfindingcharacters.cpp b/indra/newview/llfloaterpathfindingcharacters.cpp
index 69c9d94dfa..87f927ff65 100755
--- a/indra/newview/llfloaterpathfindingcharacters.cpp
+++ b/indra/newview/llfloaterpathfindingcharacters.cpp
@@ -224,7 +224,7 @@ LLSD LLFloaterPathfindingCharacters::buildCharacterScrollListItemData(const LLPa
columns[2]["column"] = "owner";
columns[2]["value"] = getOwnerName(pCharacterPtr);
- S32 cpuTime = llround(pCharacterPtr->getCPUTime());
+ S32 cpuTime = ll_round(pCharacterPtr->getCPUTime());
std::string cpuTimeString = llformat("%d", cpuTime);
LLStringUtil::format_map_t string_args;
string_args["[CPU_TIME]"] = cpuTimeString;
diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp
index d72ee073e1..f6ff83eaf4 100755
--- a/indra/newview/llfloaterpathfindingobjects.cpp
+++ b/indra/newview/llfloaterpathfindingobjects.cpp
@@ -406,7 +406,7 @@ void LLFloaterPathfindingObjects::addObjectToScrollList(const LLPathfindingObjec
if (pObjectPtr->hasOwner() && !pObjectPtr->hasOwnerName())
{
- mMissingNameObjectsScrollListItems.insert(std::make_pair<std::string, LLScrollListItem *>(pObjectPtr->getUUID().asString(), scrollListItem));
+ mMissingNameObjectsScrollListItems.insert(scroll_list_item_map::value_type(pObjectPtr->getUUID().asString(), scrollListItem));
pObjectPtr->registerOwnerNameListener(boost::bind(&LLFloaterPathfindingObjects::handleObjectNameResponse, this, _1));
}
}
diff --git a/indra/newview/llfloaterpay.cpp b/indra/newview/llfloaterpay.cpp
index f0c010b545..172f81d078 100755
--- a/indra/newview/llfloaterpay.cpp
+++ b/indra/newview/llfloaterpay.cpp
@@ -40,8 +40,10 @@
#include "lltextbox.h"
#include "lllineeditor.h"
#include "llmutelist.h"
+#include "llnotificationsutil.h"
#include "llfloaterreporter.h"
#include "llslurl.h"
+#include "llstatusbar.h"
#include "llviewerobject.h"
#include "llviewerobjectlist.h"
#include "llviewerregion.h"
@@ -90,6 +92,9 @@ public:
static void payDirectly(money_callback callback,
const LLUUID& target_id,
bool is_group);
+ static bool payConfirmationCallback(const LLSD& notification,
+ const LLSD& response,
+ LLGiveMoneyInfo* info);
private:
static void onCancel(void* data);
@@ -111,14 +116,11 @@ protected:
LLGiveMoneyInfo* mQuickPayInfo[MAX_PAY_BUTTONS];
LLSafeHandle<LLObjectSelection> mObjectSelection;
-
- static S32 sLastAmount;
};
-S32 LLFloaterPay::sLastAmount = 0;
-const S32 MAX_AMOUNT_LENGTH = 10;
const S32 FASTPAY_BUTTON_WIDTH = 80;
+const S32 PAY_AMOUNT_NOTIFICATION = 200;
LLFloaterPay::LLFloaterPay(const LLSD& key)
: LLFloater(key),
@@ -188,17 +190,9 @@ BOOL LLFloaterPay::postBuild()
getChildView("amount text")->setVisible(FALSE);
-
- std::string last_amount;
- if(sLastAmount > 0)
- {
- last_amount = llformat("%d", sLastAmount);
- }
-
getChildView("amount")->setVisible(FALSE);
getChild<LLLineEditor>("amount")->setKeystrokeCallback(&LLFloaterPay::onKeystroke, this);
- getChild<LLUICtrl>("amount")->setValue(last_amount);
getChild<LLLineEditor>("amount")->setPrevalidate(LLTextValidate::validateNonNegativeS32);
info = new LLGiveMoneyInfo(this, 0);
@@ -207,7 +201,7 @@ BOOL LLFloaterPay::postBuild()
childSetAction("pay btn",&LLFloaterPay::onGive,info);
setDefaultBtn("pay btn");
getChildView("pay btn")->setVisible(FALSE);
- getChildView("pay btn")->setEnabled((sLastAmount > 0));
+ getChildView("pay btn")->setEnabled(FALSE);
childSetAction("cancel btn",&LLFloaterPay::onCancel,this);
@@ -419,7 +413,24 @@ void LLFloaterPay::payDirectly(money_callback callback,
floater->finishPayUI(target_id, is_group);
}
-
+
+bool LLFloaterPay::payConfirmationCallback(const LLSD& notification, const LLSD& response, LLGiveMoneyInfo* info)
+{
+ if (!info || !info->mFloater)
+ {
+ return false;
+ }
+
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+ if (option == 0)
+ {
+ info->mFloater->give(info->mAmount);
+ info->mFloater->closeFloater();
+ }
+
+ return false;
+}
+
void LLFloaterPay::finishPayUI(const LLUUID& target_id, BOOL is_group)
{
std::string slurl;
@@ -470,10 +481,40 @@ void LLFloaterPay::onKeystroke(LLLineEditor*, void* data)
void LLFloaterPay::onGive(void* data)
{
LLGiveMoneyInfo* info = reinterpret_cast<LLGiveMoneyInfo*>(data);
- if(info && info->mFloater)
+ LLFloaterPay* floater = info->mFloater;
+ if(info && floater)
{
- info->mFloater->give(info->mAmount);
- info->mFloater->closeFloater();
+ S32 amount = info->mAmount;
+ if(amount == 0)
+ {
+ amount = atoi(floater->getChild<LLUICtrl>("amount")->getValue().asString().c_str());
+ }
+ if (amount > PAY_AMOUNT_NOTIFICATION && gStatusBar && gStatusBar->getBalance() > amount)
+ {
+ LLUUID payee_id;
+ BOOL is_group;
+ if (floater->mObjectSelection.notNull())
+ {
+ LLSelectNode* node = floater->mObjectSelection->getFirstRootNode();
+ node->mPermissions->getOwnership(payee_id, is_group);
+ }
+ else
+ {
+ is_group = floater->mTargetIsGroup;
+ payee_id = floater->mTargetUUID;
+ }
+
+ LLSD args;
+ args["TARGET"] = LLSLURL( is_group ? "group" : "agent", payee_id, "completename").getSLURLString();
+ args["AMOUNT"] = amount;
+
+ LLNotificationsUtil::add("PayConfirmation", args, LLSD(), boost::bind(&LLFloaterPay::payConfirmationCallback, _1, _2, info));
+ }
+ else
+ {
+ floater->give(amount);
+ floater->closeFloater();
+ }
}
}
@@ -487,7 +528,6 @@ void LLFloaterPay::give(S32 amount)
{
amount = atoi(getChild<LLUICtrl>("amount")->getValue().asString().c_str());
}
- sLastAmount = amount;
// Try to pay an object.
if (mObjectSelection.notNull())
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index cbd9867107..0ac18408db 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -113,13 +113,9 @@
#include "llfeaturemanager.h"
#include "llviewertexturelist.h"
-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";
@@ -295,8 +291,8 @@ void fractionFromDecimal(F32 decimal_val, S32& numerator, S32& denominator)
{
if (fmodf((decimal_val * test_denominator) + 0.01f, 1.f) < 0.02f)
{
- numerator = llround(decimal_val * test_denominator);
- denominator = llround(test_denominator);
+ numerator = ll_round(decimal_val * test_denominator);
+ denominator = ll_round(test_denominator);
break;
}
}
diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp
index a3b9713e3e..ae330211db 100755
--- a/indra/newview/llfloaterreporter.cpp
+++ b/indra/newview/llfloaterreporter.cpp
@@ -82,8 +82,6 @@
#include "lltrans.h"
-const U32 INCLUDE_SCREENSHOT = 0x01 << 0;
-
//-----------------------------------------------------------------------------
// Globals
//-----------------------------------------------------------------------------
diff --git a/indra/newview/llfloaterscriptlimits.h b/indra/newview/llfloaterscriptlimits.h
index a5cb1b6184..5ba0185d32 100755
--- a/indra/newview/llfloaterscriptlimits.h
+++ b/indra/newview/llfloaterscriptlimits.h
@@ -170,21 +170,17 @@ private:
LLSD mContent;
LLUUID mParcelId;
bool mGotParcelMemoryUsed;
- bool mGotParcelMemoryUsedDetails;
bool mGotParcelMemoryMax;
S32 mParcelMemoryMax;
S32 mParcelMemoryUsed;
- S32 mParcelMemoryUsedDetails;
-
+
bool mGotParcelURLsUsed;
- bool mGotParcelURLsUsedDetails;
bool mGotParcelURLsMax;
S32 mParcelURLsMax;
S32 mParcelURLsUsed;
- S32 mParcelURLsUsedDetails;
-
+
std::vector<LLSD> mObjectListItems;
-
+
protected:
// LLRemoteParcelInfoObserver interface:
@@ -208,17 +204,11 @@ public:
LLPanelScriptLimitsAttachment()
: LLPanelScriptLimitsInfo(),
mGotAttachmentMemoryUsed(false),
- mGotAttachmentMemoryUsedDetails(false),
- mGotAttachmentMemoryMax(false),
mAttachmentMemoryMax(0),
mAttachmentMemoryUsed(0),
- mAttachmentMemoryUsedDetails(0),
mGotAttachmentURLsUsed(false),
- mGotAttachmentURLsUsedDetails(false),
- mGotAttachmentURLsMax(false),
mAttachmentURLsMax(0),
- mAttachmentURLsUsed(0),
- mAttachmentURLsUsedDetails(0)
+ mAttachmentURLsUsed(0)
{};
~LLPanelScriptLimitsAttachment()
@@ -237,18 +227,12 @@ public:
private:
bool mGotAttachmentMemoryUsed;
- bool mGotAttachmentMemoryUsedDetails;
- bool mGotAttachmentMemoryMax;
S32 mAttachmentMemoryMax;
S32 mAttachmentMemoryUsed;
- S32 mAttachmentMemoryUsedDetails;
-
+
bool mGotAttachmentURLsUsed;
- bool mGotAttachmentURLsUsedDetails;
- bool mGotAttachmentURLsMax;
S32 mAttachmentURLsMax;
S32 mAttachmentURLsUsed;
- S32 mAttachmentURLsUsedDetails;
protected:
diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp
index 8677028942..971da74158 100755
--- a/indra/newview/llfloatersnapshot.cpp
+++ b/indra/newview/llfloatersnapshot.cpp
@@ -911,11 +911,11 @@ BOOL LLFloaterSnapshot::Impl::checkImageSize(LLSnapshotLivePreview* previewp, S3
//change another value proportionally
if(isWidthChanged)
{
- height = llround(width / aspect_ratio) ;
+ height = ll_round(width / aspect_ratio) ;
}
else
{
- width = llround(height * aspect_ratio) ;
+ width = ll_round(height * aspect_ratio) ;
}
//bound w/h by the max_value
diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp
index 0613ffc94d..c1c21c593e 100755
--- a/indra/newview/llfloatertos.cpp
+++ b/indra/newview/llfloatertos.cpp
@@ -50,7 +50,6 @@
LLFloaterTOS::LLFloaterTOS(const LLSD& data)
: LLModalDialog( data["message"].asString() ),
mMessage(data["message"].asString()),
- mWebBrowserWindowId( 0 ),
mLoadingScreenLoaded(false),
mSiteAlive(false),
mRealNavigateBegun(false),
diff --git a/indra/newview/llfloatertos.h b/indra/newview/llfloatertos.h
index 8921d11489..47126d06a6 100755
--- a/indra/newview/llfloatertos.h
+++ b/indra/newview/llfloatertos.h
@@ -62,7 +62,6 @@ public:
private:
std::string mMessage;
- int mWebBrowserWindowId;
bool mLoadingScreenLoaded;
bool mSiteAlive;
bool mRealNavigateBegun;
diff --git a/indra/newview/llfloatertwitter.cpp b/indra/newview/llfloatertwitter.cpp
index 868d623d57..c48b1a3325 100644
--- a/indra/newview/llfloatertwitter.cpp
+++ b/indra/newview/llfloatertwitter.cpp
@@ -54,7 +54,6 @@
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";
diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp
index bfc36a6bfb..76ad2146f1 100755
--- a/indra/newview/llfloateruipreview.cpp
+++ b/indra/newview/llfloateruipreview.cpp
@@ -180,7 +180,6 @@ private:
LLButton* mToggleOverlapButton; // button to togle overlap panel/highlighting
LLComboBox* mLanguageSelection; // combo box for primary language selection
LLComboBox* mLanguageSelection_2; // combo box for secondary language selection
- LLScrollContainer* mOverlapScrollView; // overlapping elements scroll container
S32 mLastDisplayedX, mLastDisplayedY; // stored position of last floater so the new one opens up in the same place
std::string mDelim; // the OS-specific delimiter character (/ or \) (*TODO: this shouldn't be needed, right?)
diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp
index 3f3d87b564..024e315632 100755
--- a/indra/newview/llfloaterwebcontent.cpp
+++ b/indra/newview/llfloaterwebcontent.cpp
@@ -293,6 +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
+ // MAINT-3440 note change here to use findInstance and not getInstance - latter creates an instance if it's not there which is bad.
LLFloater* fbc_web = LLFloaterReg::findInstance("fbc_web");
if (fbc_web == this)
{
@@ -302,7 +303,8 @@ void LLFloaterWebContent::onClose(bool app_quitting)
}
}
// Same with Flickr
- LLFloater* flickr_web = LLFloaterReg::getInstance("flickr_web");
+ // MAINT-3440 note change here to use findInstance and not getInstance - latter creates an instance if it's not there which is bad.
+ LLFloater* flickr_web = LLFloaterReg::findInstance("flickr_web");
if (flickr_web == this)
{
if (!LLFlickrConnect::instance().isConnected())
@@ -311,7 +313,8 @@ void LLFloaterWebContent::onClose(bool app_quitting)
}
}
// And Twitter
- LLFloater* twitter_web = LLFloaterReg::getInstance("twitter_web");
+ // MAINT-3440 note change here to use findInstance and not getInstance - latter creates an instance if it's not there which is bad.
+ LLFloater* twitter_web = LLFloaterReg::findInstance("twitter_web");
if (twitter_web == this)
{
if (!LLTwitterConnect::instance().isConnected())
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index ff66bdedb0..cc4753577d 100755
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
@@ -659,9 +659,9 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global)
F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS );
std::string full_name = llformat("%s (%d, %d, %d)",
sim_name.c_str(),
- llround(region_x),
- llround(region_y),
- llround((F32)pos_global.mdV[VZ]));
+ ll_round(region_x),
+ ll_round(region_y),
+ ll_round((F32)pos_global.mdV[VZ]));
std::string tooltip("");
mTrackedStatus = LLTracker::TRACKING_LOCATION;
diff --git a/indra/newview/llfolderviewmodelinventory.cpp b/indra/newview/llfolderviewmodelinventory.cpp
index 7615c12043..3271a40ea0 100755
--- a/indra/newview/llfolderviewmodelinventory.cpp
+++ b/indra/newview/llfolderviewmodelinventory.cpp
@@ -129,13 +129,18 @@ void LLFolderViewModelItemInventory::requestSort()
void LLFolderViewModelItemInventory::setPassedFilter(bool passed, S32 filter_generation, std::string::size_type string_offset, std::string::size_type string_size)
{
+ bool generation_skip = mMarkedDirtyGeneration >= 0
+ && mPrevPassedAllFilters
+ && mMarkedDirtyGeneration < mRootViewModel.getFilter().getFirstSuccessGeneration();
LLFolderViewModelItemCommon::setPassedFilter(passed, filter_generation, string_offset, string_size);
bool before = mPrevPassedAllFilters;
mPrevPassedAllFilters = passedFilter(filter_generation);
- if (before != mPrevPassedAllFilters)
+ if (before != mPrevPassedAllFilters || generation_skip)
{
- // 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,
+ // previously passed item skipped filter generation changes while being dirty
+ // or previously passed not yet filtered item was marked dirty
LLFolderViewFolder* parent_folder = mFolderViewItem->getParentFolder();
if (parent_folder)
{
@@ -144,6 +149,9 @@ void LLFolderViewModelItemInventory::setPassedFilter(bool passed, S32 filter_gen
}
}
+
+
+
bool LLFolderViewModelItemInventory::filterChildItem( LLFolderViewModelItem* item, LLFolderViewFilter& filter )
{
S32 filter_generation = filter.getCurrentGeneration();
diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp
index 4b8ac2b3cf..c80dec0e75 100755
--- a/indra/newview/llglsandbox.cpp
+++ b/indra/newview/llglsandbox.cpp
@@ -80,10 +80,10 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask)
S32 top = llmax(y, mDragStartY);
S32 bottom =llmin(y, mDragStartY);
- left = llround((F32) left * LLUI::getScaleFactor().mV[VX]);
- right = llround((F32) right * LLUI::getScaleFactor().mV[VX]);
- top = llround((F32) top * LLUI::getScaleFactor().mV[VY]);
- bottom = llround((F32) bottom * LLUI::getScaleFactor().mV[VY]);
+ left = ll_round((F32) left * LLUI::getScaleFactor().mV[VX]);
+ right = ll_round((F32) right * LLUI::getScaleFactor().mV[VX]);
+ top = ll_round((F32) top * LLUI::getScaleFactor().mV[VY]);
+ bottom = ll_round((F32) bottom * LLUI::getScaleFactor().mV[VY]);
F32 old_far_plane = LLViewerCamera::getInstance()->getFar();
F32 old_near_plane = LLViewerCamera::getInstance()->getNear();
@@ -881,13 +881,14 @@ void LLViewerObjectList::renderObjectBeacons()
F32 gpu_benchmark()
{
- if (!gGLManager.mHasShaderObjects)
- { //don't bother benchmarking the fixed function
+ if (!gGLManager.mHasShaderObjects || !gGLManager.mHasTimerQuery)
+ { // don't bother benchmarking the fixed function
+ // or venerable drivers which don't support accurate timing anyway
+ // and are likely to be correctly identified by the GPU table already.
return -1.f;
}
-
- if (gBenchmarkProgram.mProgramObject == 0)
+ if (gBenchmarkProgram.mProgramObject == 0)
{
LLViewerShaderMgr::instance()->initAttribsAndUniforms();
@@ -920,7 +921,10 @@ F32 gpu_benchmark()
//number of samples to take
const S32 samples = 64;
- LLGLSLShader::initProfile();
+ if (gGLManager.mHasTimerQuery)
+ {
+ LLGLSLShader::initProfile();
+ }
LLRenderTarget dest[count];
U32 source[count];
@@ -964,16 +968,16 @@ F32 gpu_benchmark()
v[0].set(-1,1,0);
v[1].set(-1,-3,0);
v[2].set(3,1,0);
+
buff->flush();
gBenchmarkProgram.bind();
- buff->setBuffer(LLVertexBuffer::MAP_VERTEX);
-
- //wait for any previoius GL commands to finish
- glFinish();
bool busted_finish = false;
+ buff->setBuffer(LLVertexBuffer::MAP_VERTEX);
+ glFinish();
+
for (S32 c = -1; c < samples; ++c)
{
LLTimer timer;
@@ -1013,6 +1017,7 @@ F32 gpu_benchmark()
if (!gGLManager.mHasTimerQuery && !busted_finish && gbps > 128.f)
{ //unrealistically high bandwidth for a card without timer queries, glFinish is probably ignored
busted_finish = true;
+ LL_WARNS() << "GPU Benchmark detected GL driver with broken glFinish implementation." << LL_ENDL;
}
else
{
@@ -1023,10 +1028,12 @@ F32 gpu_benchmark()
gBenchmarkProgram.unbind();
- LLGLSLShader::finishProfile(false);
-
- LLImageGL::deleteTextures(count, source);
+ if (gGLManager.mHasTimerQuery)
+ {
+ LLGLSLShader::finishProfile(false);
+ }
+ LLImageGL::deleteTextures(count, source);
std::sort(results.begin(), results.end());
@@ -1037,27 +1044,20 @@ F32 gpu_benchmark()
#if LL_DARWIN
if (gbps > 512.f)
{
- LL_INFOS() << "Memory bandwidth is improbably high and likely incorrect." << LL_ENDL;
+ LL_WARNS() << "Memory bandwidth is improbably high and likely incorrect; discarding result." << LL_ENDL;
//OSX is probably lying, discard result
gbps = -1.f;
}
#endif
- if (gGLManager.mHasTimerQuery)
- {
- F32 ms = gBenchmarkProgram.mTimeElapsed/1000000.f;
- F32 seconds = ms/1000.f;
+ F32 ms = gBenchmarkProgram.mTimeElapsed/1000000.f;
+ F32 seconds = ms/1000.f;
- F64 samples_drawn = res*res*count*samples;
- F32 samples_sec = (samples_drawn/1000000000.0)/seconds;
- gbps = samples_sec*8;
+ F64 samples_drawn = res*res*count*samples;
+ F32 samples_sec = (samples_drawn/1000000000.0)/seconds;
+ gbps = samples_sec*8;
- LL_INFOS() << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to ARB_timer_query" << LL_ENDL;
- }
- else
- {
- LL_INFOS() << "ARB_timer_query unavailable." << LL_ENDL;
- }
+ LL_INFOS() << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to ARB_timer_query" << LL_ENDL;
return gbps;
}
diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp
index b1b7a87ae8..ef238cefe3 100755
--- a/indra/newview/llgrouplist.cpp
+++ b/indra/newview/llgrouplist.cpp
@@ -50,6 +50,8 @@ S32 LLGroupListItem::sIconWidth = 0;
class LLGroupComparator : public LLFlatListView::ItemComparator
{
public:
+ LLGroupComparator() {};
+
/** Returns true if item1 < item2, false otherwise */
/*virtual*/ bool compare(const LLPanel* item1, const LLPanel* item2) const
{
diff --git a/indra/newview/llhudeffecttrail.cpp b/indra/newview/llhudeffecttrail.cpp
index 8771219034..fc6efdb840 100755
--- a/indra/newview/llhudeffecttrail.cpp
+++ b/indra/newview/llhudeffecttrail.cpp
@@ -42,13 +42,6 @@
#include "llvoavatar.h"
#include "llworld.h"
-
-const F32 PARTICLE_SPACING = 0.01f;
-const F32 MAX_SIZE = 0.025f;
-const F32 START_POS_MAG = 1.f;
-const F32 END_POS_MAG = 1.2f;
-
-
LLHUDEffectSpiral::LLHUDEffectSpiral(const U8 type) : LLHUDEffect(type), mbInit(FALSE)
{
mKillTime = 10.f;
diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp
index 31d832e524..c7d108b6de 100755
--- a/indra/newview/llhudnametag.cpp
+++ b/indra/newview/llhudnametag.cpp
@@ -52,17 +52,12 @@
const F32 SPRING_STRENGTH = 0.7f;
-const F32 RESTORATION_SPRING_TIME_CONSTANT = 0.1f;
const F32 HORIZONTAL_PADDING = 16.f;
const F32 VERTICAL_PADDING = 12.f;
const F32 LINE_PADDING = 3.f; // aka "leading"
const F32 BUFFER_SIZE = 2.f;
-const F32 MIN_EDGE_OVERLAP = 3.f;
const F32 HUD_TEXT_MAX_WIDTH = 190.f;
-const F32 HUD_TEXT_MAX_WIDTH_NO_BUBBLE = 1000.f;
-const F32 RESIZE_TIME = 0.f;
const S32 NUM_OVERLAP_ITERATIONS = 10;
-const F32 NEIGHBOR_FORCE_FRACTION = 1.f;
const F32 POSITION_DAMPING_TC = 0.2f;
const F32 MAX_STABLE_CAMERA_VELOCITY = 0.1f;
const F32 LOD_0_SCREEN_COVERAGE = 0.15f;
@@ -315,7 +310,7 @@ void LLHUDNameTag::renderText(BOOL for_select)
{
LLUIImagePtr rect_top_image = LLUI::getUIImage("Rounded_Rect_Top");
LLRect label_top_rect = screen_rect;
- const S32 label_height = llround((mFontp->getLineHeight() * (F32)mLabelSegments.size() + (VERTICAL_PADDING / 3.f)));
+ const S32 label_height = ll_round((mFontp->getLineHeight() * (F32)mLabelSegments.size() + (VERTICAL_PADDING / 3.f)));
label_top_rect.mBottom = label_top_rect.mTop - label_height;
LLColor4 label_top_color = text_color;
label_top_color.mV[VALPHA] = gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor;
diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp
index f648d7baae..2c204170f2 100755
--- a/indra/newview/llhudtext.cpp
+++ b/indra/newview/llhudtext.cpp
@@ -48,23 +48,11 @@
#include "pipeline.h"
#include <boost/tokenizer.hpp>
-
-const F32 SPRING_STRENGTH = 0.7f;
-const F32 RESTORATION_SPRING_TIME_CONSTANT = 0.1f;
const F32 HORIZONTAL_PADDING = 15.f;
const F32 VERTICAL_PADDING = 12.f;
const F32 BUFFER_SIZE = 2.f;
-const F32 MIN_EDGE_OVERLAP = 3.f;
const F32 HUD_TEXT_MAX_WIDTH = 190.f;
const F32 HUD_TEXT_MAX_WIDTH_NO_BUBBLE = 1000.f;
-const F32 RESIZE_TIME = 0.f;
-const S32 NUM_OVERLAP_ITERATIONS = 10;
-const F32 NEIGHBOR_FORCE_FRACTION = 1.f;
-const F32 POSITION_DAMPING_TC = 0.2f;
-const F32 MAX_STABLE_CAMERA_VELOCITY = 0.1f;
-//const F32 LOD_0_SCREEN_COVERAGE = 0.15f;
-//const F32 LOD_1_SCREEN_COVERAGE = 0.30f;
-//const F32 LOD_2_SCREEN_COVERAGE = 0.40f;
std::set<LLPointer<LLHUDText> > LLHUDText::sTextObjects;
std::vector<LLPointer<LLHUDText> > LLHUDText::sVisibleTextObjects;
diff --git a/indra/newview/llhudview.cpp b/indra/newview/llhudview.cpp
index 9a63e99357..cead4dbce6 100755
--- a/indra/newview/llhudview.cpp
+++ b/indra/newview/llhudview.cpp
@@ -44,10 +44,6 @@
LLHUDView *gHUDView = NULL;
-const S32 HUD_ARROW_SIZE = 32;
-
-
-
LLHUDView::LLHUDView(const LLRect& r)
{
buildFromFile( "panel_hud.xml");
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 33e557cddd..1910656066 100755
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -87,6 +87,8 @@ void copy_slurl_to_clipboard_callback_inv(const std::string& slurl);
typedef std::pair<LLUUID, LLUUID> two_uuids_t;
typedef std::list<two_uuids_t> two_uuids_list_t;
+const F32 SOUND_GAIN = 1.0f;
+
struct LLMoveInv
{
LLUUID mObjectID;
@@ -2785,8 +2787,8 @@ void LLRightClickInventoryFetchDescendentsObserver::execute(bool clear_observer)
class LLInventoryCopyAndWearObserver : public LLInventoryObserver
{
public:
- LLInventoryCopyAndWearObserver(const LLUUID& cat_id, int count, bool folder_added=false) :
- mCatID(cat_id), mContentsCount(count), mFolderAdded(folder_added) {}
+ LLInventoryCopyAndWearObserver(const LLUUID& cat_id, int count, bool folder_added=false, bool replace=false) :
+ mCatID(cat_id), mContentsCount(count), mFolderAdded(folder_added), mReplace(replace){}
virtual ~LLInventoryCopyAndWearObserver() {}
virtual void changed(U32 mask);
@@ -2794,6 +2796,7 @@ protected:
LLUUID mCatID;
int mContentsCount;
bool mFolderAdded;
+ bool mReplace;
};
@@ -2832,7 +2835,7 @@ void LLInventoryCopyAndWearObserver::changed(U32 mask)
mContentsCount)
{
gInventory.removeObserver(this);
- LLAppearanceMgr::instance().wearInventoryCategory(category, FALSE, TRUE);
+ LLAppearanceMgr::instance().wearInventoryCategory(category, FALSE, !mReplace);
delete this;
}
}
@@ -3779,24 +3782,21 @@ void LLFolderBridge::modifyOutfit(BOOL append)
// 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;
- }
+ 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 );
@@ -3816,7 +3816,8 @@ bool move_task_inventory_callback(const LLSD& notification, const LLSD& response
LLInventoryObject::object_list_t inventory_objects;
object->getInventoryContents(inventory_objects);
int contents_count = inventory_objects.size()-1; //subtract one for containing folder
- LLInventoryCopyAndWearObserver* inventoryObserver = new LLInventoryCopyAndWearObserver(cat_and_wear->mCatID, contents_count, cat_and_wear->mFolderResponded);
+ LLInventoryCopyAndWearObserver* inventoryObserver = new LLInventoryCopyAndWearObserver(cat_and_wear->mCatID, contents_count, cat_and_wear->mFolderResponded,
+ cat_and_wear->mReplace);
gInventory.addObserver(inventoryObserver);
}
@@ -4526,6 +4527,23 @@ void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
hide_context_entries(menu, items, disabled_items);
}
+void LLSoundBridge::performAction(LLInventoryModel* model, std::string action)
+{
+ if ("sound_play" == action)
+ {
+ LLViewerInventoryItem* item = getItem();
+ if(item)
+ {
+ send_sound_trigger(item->getAssetUUID(), SOUND_GAIN);
+ }
+ }
+ else if ("open" == action)
+ {
+ openSoundPreview((void*)this);
+ }
+ else LLItemBridge::performAction(model, action);
+}
+
// +=================================================+
// | LLLandmarkBridge |
// +=================================================+
@@ -5326,16 +5344,20 @@ std::string LLObjectBridge::getLabelSuffix() const
{
return LLItemBridge::getLabelSuffix() + LLTrans::getString("worn");
}
- std::string attachment_point_name = gAgentAvatarp->getAttachedPointName(mUUID);
- if (attachment_point_name == LLStringUtil::null) // Error condition, invalid attach point
+ std::string attachment_point_name;
+ if (gAgentAvatarp->getAttachedPointName(mUUID, attachment_point_name))
{
- attachment_point_name = "Invalid Attachment";
- }
- // e.g. "(worn on ...)" / "(attached to ...)"
- LLStringUtil::format_map_t args;
- args["[ATTACHMENT_POINT]"] = LLTrans::getString(attachment_point_name);
+ LLStringUtil::format_map_t args;
+ args["[ATTACHMENT_POINT]"] = LLTrans::getString(attachment_point_name);
- return LLItemBridge::getLabelSuffix() + LLTrans::getString("WornOnAttachmentPoint", args);
+ return LLItemBridge::getLabelSuffix() + LLTrans::getString("WornOnAttachmentPoint", args);
+ }
+ else
+ {
+ LLStringUtil::format_map_t args;
+ args["[ATTACHMENT_ERROR]"] = LLTrans::getString(attachment_point_name);
+ return LLItemBridge::getLabelSuffix() + LLTrans::getString("AttachmentErrorMessage", args);
+ }
}
return LLItemBridge::getLabelSuffix();
}
@@ -6138,7 +6160,7 @@ public:
LLViewerInventoryItem* item = getItem();
if (item)
{
- LLFloaterReg::showInstance("preview_sound", LLSD(mUUID), TAKE_FOCUS_YES);
+ send_sound_trigger(item->getAssetUUID(), SOUND_GAIN);
}
LLInvFVBridgeAction::doIt();
}
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index 833fbbadbb..f8ef15991d 100755
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -199,6 +199,7 @@ protected:
class LLInventoryFolderViewModelBuilder
{
public:
+ LLInventoryFolderViewModelBuilder() {}
virtual ~LLInventoryFolderViewModelBuilder() {}
virtual LLInvFVBridge* createBridge(LLAssetType::EType asset_type,
LLAssetType::EType actual_asset_type,
@@ -389,6 +390,7 @@ public:
LLItemBridge(inventory, root, uuid) {}
virtual void openItem();
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
+ virtual void performAction(LLInventoryModel* model, std::string action);
static void openSoundPreview(void*);
};
@@ -653,6 +655,7 @@ public:
class LLRecentInventoryBridgeBuilder : public LLInventoryFolderViewModelBuilder
{
public:
+ LLRecentInventoryBridgeBuilder() {}
// Overrides FolderBridge for Recent Inventory Panel.
// It use base functionality for bridges other than FolderBridge.
virtual LLInvFVBridge* createBridge(LLAssetType::EType asset_type,
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index f211acedf0..c66e9da4a9 100755
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -126,13 +126,6 @@ bool LLInventoryFilter::checkFolder(const LLFolderViewModelItem* item) const
bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const
{
- // when applying a filter, matching folders get their contents downloaded first
- if (isNotDefault()
- && !gInventory.isCategoryComplete(folder_id))
- {
- LLInventoryModelBackgroundFetch::instance().start(folder_id);
- }
-
// Always check against the clipboard
const BOOL passed_clipboard = checkAgainstClipboard(folder_id);
@@ -142,6 +135,13 @@ bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const
return passed_clipboard;
}
+ // when applying a filter, matching folders get their contents downloaded first
+ if (mFilterSubString.size()
+ && !gInventory.isCategoryComplete(folder_id))
+ {
+ LLInventoryModelBackgroundFetch::instance().start(folder_id);
+ }
+
// show folder links
LLViewerInventoryItem* item = gInventory.getItem(folder_id);
if (item && item->getActualType() == LLAssetType::AT_LINK_FOLDER)
@@ -550,7 +550,7 @@ void LLInventoryFilter::setFilterSubString(const std::string& string)
if (mFilterOps.mFilterTypes == FILTERTYPE_UUID)
{
mFilterOps.mFilterTypes &= ~FILTERTYPE_UUID;
- mFilterOps.mFilterUUID == LLUUID::null;
+ mFilterOps.mFilterUUID = LLUUID::null;
setModified(FILTER_RESTART);
}
@@ -663,13 +663,13 @@ void LLInventoryFilter::setHoursAgo(U32 hours)
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);
+ 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);
+ 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;
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index e18ecd2e2a..3546317471 100755
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -542,12 +542,13 @@ void LLInventoryPanel::modelChanged(U32 mask)
// This item already exists in both memory and UI. It was probably reparented.
else if (model_item && view_item)
{
+ LLFolderViewFolder* old_parent = view_item->getParentFolder();
// Don't process the item if it is the root
- if (view_item->getParentFolder())
+ if (old_parent)
{
LLFolderViewFolder* new_parent = (LLFolderViewFolder*)getItemByID(model_item->getParentUUID());
// Item has been moved.
- if (view_item->getParentFolder() != new_parent)
+ if (old_parent != new_parent)
{
if (new_parent != NULL)
{
@@ -573,6 +574,7 @@ void LLInventoryPanel::modelChanged(U32 mask)
// doesn't include trash). Just remove the item's UI.
view_item->destroyView();
}
+ old_parent->getViewModelItem()->dirtyDescendantsFilter();
}
}
}
@@ -583,27 +585,16 @@ void LLInventoryPanel::modelChanged(U32 mask)
else if (!model_item && view_item && viewmodel_item)
{
// Remove the item's UI.
- removeItemID(viewmodel_item->getUUID());
+ LLFolderViewFolder* parent = view_item->getParentFolder();
+ removeItemID(viewmodel_item->getUUID());
view_item->destroyView();
+ if(parent)
+ {
+ parent->getViewModelItem()->dirtyDescendantsFilter();
+ }
}
}
}
-
- 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()
diff --git a/indra/newview/lllandmarkactions.cpp b/indra/newview/lllandmarkactions.cpp
index f893daaeb2..9c00243f44 100755
--- a/indra/newview/lllandmarkactions.cpp
+++ b/indra/newview/lllandmarkactions.cpp
@@ -74,9 +74,9 @@ public:
if (!landmark->getGlobalPos(landmark_global_pos))
return false;
//we have to round off each coordinates to compare positions properly
- return llround(mPos.mdV[VX]) == llround(landmark_global_pos.mdV[VX])
- && llround(mPos.mdV[VY]) == llround(landmark_global_pos.mdV[VY])
- && llround(mPos.mdV[VZ]) == llround(landmark_global_pos.mdV[VZ]);
+ return ll_round(mPos.mdV[VX]) == ll_round(landmark_global_pos.mdV[VX])
+ && ll_round(mPos.mdV[VY]) == ll_round(landmark_global_pos.mdV[VY])
+ && ll_round(mPos.mdV[VZ]) == ll_round(landmark_global_pos.mdV[VZ]);
}
};
@@ -320,7 +320,7 @@ void LLLandmarkActions::getRegionNameAndCoordsFromPosGlobal(const LLVector3d& gl
{
LLVector3 pos = sim_infop->getLocalPos(global_pos);
std::string name = sim_infop->getName() ;
- cb(name, llround(pos.mV[VX]), llround(pos.mV[VY]),llround(pos.mV[VZ]));
+ cb(name, ll_round(pos.mV[VX]), ll_round(pos.mV[VY]),ll_round(pos.mV[VZ]));
}
else
{
@@ -364,7 +364,7 @@ void LLLandmarkActions::onRegionResponseNameAndCoords(region_name_and_coords_cal
{
LLVector3 local_pos = sim_infop->getLocalPos(global_pos);
std::string name = sim_infop->getName() ;
- cb(name, llround(local_pos.mV[VX]), llround(local_pos.mV[VY]), llround(local_pos.mV[VZ]));
+ cb(name, ll_round(local_pos.mV[VX]), ll_round(local_pos.mV[VY]), ll_round(local_pos.mV[VZ]));
}
}
diff --git a/indra/newview/lllocalbitmaps.cpp b/indra/newview/lllocalbitmaps.cpp
index 897ee8429a..2c2e66e08f 100755
--- a/indra/newview/lllocalbitmaps.cpp
+++ b/indra/newview/lllocalbitmaps.cpp
@@ -74,7 +74,6 @@ bool LLLocalBitmapMgr::sNeedsRebake;
static const F32 LL_LOCAL_TIMER_HEARTBEAT = 3.0;
static const BOOL LL_LOCAL_USE_MIPMAPS = true;
static const S32 LL_LOCAL_DISCARD_LEVEL = 0;
-static const U32 LL_LOCAL_TEXLAYER_FOR_IDX = 0;
static const bool LL_LOCAL_SLAM_FOR_DEBUG = true;
static const bool LL_LOCAL_REPLACE_ON_DEL = true;
static const S32 LL_LOCAL_UPDATE_RETRIES = 5;
diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp
index 06e517a861..cadbc16f1e 100755
--- a/indra/newview/lllogchat.cpp
+++ b/indra/newview/lllogchat.cpp
@@ -1022,7 +1022,7 @@ void LLLoadHistoryThread::run()
{
loadHistory(mFileName, mMessages, mLoadParams);
int count = mMessages->size();
- llinfos << "mMessages->size(): " << count << llendl;
+ LL_INFOS() << "mMessages->size(): " << count << LL_ENDL;
setFinished();
}
}
diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp
index df59283bc4..b4d0bb6823 100755
--- a/indra/newview/lllogininstance.cpp
+++ b/indra/newview/lllogininstance.cpp
@@ -58,7 +58,6 @@
#include "llmachineid.h"
#include "llupdaterservice.h"
#include "llevents.h"
-#include "llnotificationsutil.h"
#include "llappviewer.h"
#include <boost/scoped_ptr.hpp>
@@ -75,9 +74,14 @@ namespace {
{
public:
MandatoryUpdateMachine(LLLoginInstance & loginInstance, LLUpdaterService & updaterService);
-
+
void start(void);
-
+
+ LLNotificationsInterface& getNotificationsInterface() const
+ {
+ return mLoginInstance.getNotificationsInterface();
+ }
+
private:
class State;
class CheckingForUpdate;
@@ -85,9 +89,9 @@ namespace {
class ReadyToInstall;
class StartingUpdaterService;
class WaitingForDownload;
-
- LLLoginInstance & mLoginInstance;
+
boost::scoped_ptr<State> mState;
+ LLLoginInstance & mLoginInstance;
LLUpdaterService & mUpdaterService;
void setCurrentState(State * newState);
@@ -145,7 +149,7 @@ namespace {
virtual void exit(void);
private:
- MandatoryUpdateMachine & mMachine;
+ //MandatoryUpdateMachine & mMachine;
};
@@ -328,7 +332,7 @@ MandatoryUpdateMachine::Error::Error(MandatoryUpdateMachine & machine):
void MandatoryUpdateMachine::Error::enter(void)
{
LL_INFOS() << "entering error" << LL_ENDL;
- LLNotificationsUtil::add("FailedRequiredUpdateInstall", LLSD(), LLSD(), boost::bind(&MandatoryUpdateMachine::Error::onButtonClicked, this, _1, _2));
+ mMachine.getNotificationsInterface().add("FailedRequiredUpdateInstall", LLSD(), LLSD(), boost::bind(&MandatoryUpdateMachine::Error::onButtonClicked, this, _1, _2));
}
@@ -349,8 +353,8 @@ void MandatoryUpdateMachine::Error::onButtonClicked(const LLSD &, const LLSD &)
//-----------------------------------------------------------------------------
-MandatoryUpdateMachine::ReadyToInstall::ReadyToInstall(MandatoryUpdateMachine & machine):
- mMachine(machine)
+MandatoryUpdateMachine::ReadyToInstall::ReadyToInstall(MandatoryUpdateMachine & machine) //:
+ //mMachine(machine)
{
; // No op.
}
@@ -384,7 +388,7 @@ MandatoryUpdateMachine::StartingUpdaterService::StartingUpdaterService(Mandatory
void MandatoryUpdateMachine::StartingUpdaterService::enter(void)
{
LL_INFOS() << "entering start update service" << LL_ENDL;
- LLNotificationsUtil::add("UpdaterServiceNotRunning", LLSD(), LLSD(), boost::bind(&MandatoryUpdateMachine::StartingUpdaterService::onButtonClicked, this, _1, _2));
+ mMachine.getNotificationsInterface().add("UpdaterServiceNotRunning", LLSD(), LLSD(), boost::bind(&MandatoryUpdateMachine::StartingUpdaterService::onButtonClicked, this, _1, _2));
}
diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h
index b0247da7c8..c6773bbf68 100755
--- a/indra/newview/lllogininstance.h
+++ b/indra/newview/lllogininstance.h
@@ -70,6 +70,7 @@ public:
void setPlatformInfo(const std::string platform, const std::string platform_version);
void setNotificationsInterface(LLNotificationsInterface* ni) { mNotifications = ni; }
+ LLNotificationsInterface& getNotificationsInterface() const { return *mNotifications; }
typedef boost::function<void()> UpdaterLauncherCallback;
void setUpdaterLauncher(const UpdaterLauncherCallback& ulc) { mUpdaterLauncher = ulc; }
diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp
index 0935691ebc..8567180dd6 100755
--- a/indra/newview/llmanip.cpp
+++ b/indra/newview/llmanip.cpp
@@ -521,8 +521,8 @@ void LLManip::renderTickValue(const LLVector3& pos, F32 value, const std::string
std::string val_string;
std::string fraction_string;
- F32 val_to_print = llround(value, 0.001f);
- S32 fractional_portion = llround(fmodf(llabs(val_to_print), 1.f) * 100.f);
+ F32 val_to_print = ll_round(value, 0.001f);
+ S32 fractional_portion = ll_round(fmodf(llabs(val_to_print), 1.f) * 100.f);
if (val_to_print < 0.f)
{
if (fractional_portion == 0)
diff --git a/indra/newview/llmaniprotate.cpp b/indra/newview/llmaniprotate.cpp
index 7861573908..f172aa0955 100755
--- a/indra/newview/llmaniprotate.cpp
+++ b/indra/newview/llmaniprotate.cpp
@@ -368,9 +368,9 @@ void LLManipRotate::render()
LLQuaternion object_rot = first_object->getRotationEdit();
object_rot.getEulerAngles(&(euler_angles.mV[VX]), &(euler_angles.mV[VY]), &(euler_angles.mV[VZ]));
euler_angles *= RAD_TO_DEG;
- euler_angles.mV[VX] = llround(fmodf(euler_angles.mV[VX] + 360.f, 360.f), 0.05f);
- euler_angles.mV[VY] = llround(fmodf(euler_angles.mV[VY] + 360.f, 360.f), 0.05f);
- euler_angles.mV[VZ] = llround(fmodf(euler_angles.mV[VZ] + 360.f, 360.f), 0.05f);
+ euler_angles.mV[VX] = ll_round(fmodf(euler_angles.mV[VX] + 360.f, 360.f), 0.05f);
+ euler_angles.mV[VY] = ll_round(fmodf(euler_angles.mV[VY] + 360.f, 360.f), 0.05f);
+ euler_angles.mV[VZ] = ll_round(fmodf(euler_angles.mV[VZ] + 360.f, 360.f), 0.05f);
renderXYZ(euler_angles);
}
@@ -1240,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;
@@ -1524,7 +1524,6 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y )
F32 mouse_angle = fmodf(atan2(projected_mouse * axis1, projected_mouse * axis2) * RAD_TO_DEG + 360.f, 360.f);
F32 relative_mouse_angle = fmodf(mouse_angle + (SNAP_ANGLE_DETENTE / 2), SNAP_ANGLE_INCREMENT);
- //fmodf(llround(mouse_angle * RAD_TO_DEG, 7.5f) + 360.f, 360.f);
LLVector3 object_axis;
getObjectAxisClosestToMouse(object_axis);
@@ -1608,7 +1607,6 @@ LLQuaternion LLManipRotate::dragConstrained( S32 x, S32 y )
F32 mouse_angle = fmodf(atan2(projected_mouse * axis1, projected_mouse * axis2) * RAD_TO_DEG + 360.f, 360.f);
F32 relative_mouse_angle = fmodf(mouse_angle + (SNAP_ANGLE_DETENTE / 2), SNAP_ANGLE_INCREMENT);
- //fmodf(llround(mouse_angle * RAD_TO_DEG, 7.5f) + 360.f, 360.f);
LLVector3 object_axis;
getObjectAxisClosestToMouse(object_axis);
@@ -1638,9 +1636,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 2810941d83..ed833cba53 100755
--- a/indra/newview/llmanipscale.cpp
+++ b/indra/newview/llmanipscale.cpp
@@ -229,8 +229,6 @@ void LLManipScale::render()
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)
{
for (S32 i = 0; i < NUM_MANIPULATORS; i++)
@@ -1554,8 +1552,8 @@ void LLManipScale::updateSnapGuides(const LLBBox& bbox)
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());
+ mTickPixelSpacing1 = ll_round((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir1).length());
+ mTickPixelSpacing2 = ll_round((F32)MIN_DIVISION_PIXEL_WIDTH / (mScaleDir % mSnapGuideDir2).length());
if (uniform)
{
@@ -1626,8 +1624,8 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
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) / smallest_subdivision1);
- S32 sub_div_offset_2 = llround(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 / sGridMinSubdivisionLevel) / smallest_subdivision2);
+ S32 sub_div_offset_1 = ll_round(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 / sGridMinSubdivisionLevel) / smallest_subdivision1);
+ S32 sub_div_offset_2 = ll_round(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 / sGridMinSubdivisionLevel) / smallest_subdivision2);
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));
@@ -1681,7 +1679,7 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
LLVector2 screen_translate_axis(llabs(mScaleDir * LLViewerCamera::getInstance()->getLeftAxis()), llabs(mScaleDir * LLViewerCamera::getInstance()->getUpAxis()));
screen_translate_axis.normalize();
- S32 tick_label_spacing = llround(screen_translate_axis * sTickLabelSpacing);
+ S32 tick_label_spacing = ll_round(screen_translate_axis * sTickLabelSpacing);
for (pass = 0; pass < 3; pass++)
{
@@ -1761,8 +1759,8 @@ void LLManipScale::renderSnapGuides(const LLBBox& bbox)
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) / smallest_subdivision1);
- S32 label_sub_div_offset_2 = llround(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 * 32.f) / smallest_subdivision2);
+ S32 label_sub_div_offset_1 = ll_round(fmod(dist_grid_axis - grid_offset1, mScaleSnapUnit1 * 32.f) / smallest_subdivision1);
+ S32 label_sub_div_offset_2 = ll_round(fmod(dist_grid_axis - grid_offset2, mScaleSnapUnit2 * 32.f) / smallest_subdivision2);
for (S32 i = start_tick; i <= stop_tick; i++)
{
diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp
index d22672bc16..394db71fb9 100755
--- a/indra/newview/llmaniptranslate.cpp
+++ b/indra/newview/llmaniptranslate.cpp
@@ -65,7 +65,6 @@
const S32 NUM_AXES = 3;
const S32 MOUSE_DRAG_SLOP = 2; // pixels
-const F32 HANDLE_HIDE_ANGLE = 0.15f; // radians
const F32 SELECTED_ARROW_SCALE = 1.3f;
const F32 MANIPULATOR_HOTSPOT_START = 0.2f;
const F32 MANIPULATOR_HOTSPOT_END = 1.2f;
@@ -1246,7 +1245,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(fmodf(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() / sGridMinSubdivisionLevel) / smallest_grid_unit_scale);
+ S32 sub_div_offset = ll_round(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);
@@ -1361,12 +1360,12 @@ void LLManipTranslate::renderSnapGuides()
}
}
- sub_div_offset = llround(fmod(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() * 32.f) / smallest_grid_unit_scale);
+ sub_div_offset = ll_round(fmod(dist_grid_axis - offset_nearest_grid_unit, getMinGridScale() * 32.f) / smallest_grid_unit_scale);
LLVector2 screen_translate_axis(llabs(translate_axis * LLViewerCamera::getInstance()->getLeftAxis()), llabs(translate_axis * LLViewerCamera::getInstance()->getUpAxis()));
screen_translate_axis.normVec();
- S32 tick_label_spacing = llround(screen_translate_axis * sTickLabelSpacing);
+ S32 tick_label_spacing = ll_round(screen_translate_axis * sTickLabelSpacing);
// render tickmark values
for (S32 i = -num_ticks_per_side; i <= num_ticks_per_side; i++)
@@ -1404,7 +1403,7 @@ void LLManipTranslate::renderSnapGuides()
F32 offset_val = 0.5f * tick_offset.mV[ARROW_TO_AXIS[mManipPart]] / getMinGridScale();
EGridMode grid_mode = LLSelectMgr::getInstance()->getGridMode();
F32 text_highlight = 0.8f;
- if(i - llround(offset_nearest_grid_unit / smallest_grid_unit_scale) == 0 && mInSnapRegime)
+ if(i - ll_round(offset_nearest_grid_unit / smallest_grid_unit_scale) == 0 && mInSnapRegime)
{
text_highlight = 1.f;
}
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index f4e08dc790..b96bdd73ff 100755
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -120,8 +120,8 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) :
if(!getDecoupleTextureSize())
{
- S32 screen_width = llround((F32)getRect().getWidth() * LLUI::getScaleFactor().mV[VX]);
- S32 screen_height = llround((F32)getRect().getHeight() * LLUI::getScaleFactor().mV[VY]);
+ S32 screen_width = ll_round((F32)getRect().getWidth() * LLUI::getScaleFactor().mV[VX]);
+ S32 screen_height = ll_round((F32)getRect().getHeight() * LLUI::getScaleFactor().mV[VY]);
setTextureSize(screen_width, screen_height);
}
@@ -474,8 +474,8 @@ void LLMediaCtrl::reshape( S32 width, S32 height, BOOL called_from_parent )
{
if(!getDecoupleTextureSize())
{
- S32 screen_width = llround((F32)width * LLUI::getScaleFactor().mV[VX]);
- S32 screen_height = llround((F32)height * LLUI::getScaleFactor().mV[VY]);
+ S32 screen_width = ll_round((F32)width * LLUI::getScaleFactor().mV[VX]);
+ S32 screen_height = ll_round((F32)height * LLUI::getScaleFactor().mV[VY]);
// when floater is minimized, these sizes are negative
if ( screen_height > 0 && screen_width > 0 )
@@ -789,13 +789,13 @@ void LLMediaCtrl::draw()
{
// max width, adjusted height
width = r.getWidth();
- height = llmin(llmax(llround(width / media_aspect), 0), r.getHeight());
+ height = llmin(llmax(ll_round(width / media_aspect), 0), r.getHeight());
}
else
{
// max height, adjusted width
height = r.getHeight();
- width = llmin(llmax(llround(height * media_aspect), 0), r.getWidth());
+ width = llmin(llmax(ll_round(height * media_aspect), 0), r.getWidth());
}
}
else
@@ -879,14 +879,14 @@ void LLMediaCtrl::convertInputCoords(S32& x, S32& y)
coords_opengl = mMediaSource->getMediaPlugin()->getTextureCoordsOpenGL();
}
- x = llround((F32)x * LLUI::getScaleFactor().mV[VX]);
+ x = ll_round((F32)x * LLUI::getScaleFactor().mV[VX]);
if ( ! coords_opengl )
{
- y = llround((F32)(y) * LLUI::getScaleFactor().mV[VY]);
+ y = ll_round((F32)(y) * LLUI::getScaleFactor().mV[VY]);
}
else
{
- y = llround((F32)(getRect().getHeight() - y) * LLUI::getScaleFactor().mV[VY]);
+ y = ll_round((F32)(getRect().getHeight() - y) * LLUI::getScaleFactor().mV[VY]);
};
}
diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp
index 691be13610..2fb9e60b29 100755
--- a/indra/newview/llmediadataclient.cpp
+++ b/indra/newview/llmediadataclient.cpp
@@ -92,7 +92,7 @@ std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::request_queue
std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::Request &q);
template <typename T>
-static typename T::iterator find_matching_request(T &c, const LLMediaDataClient::Request *request, LLMediaDataClient::Request::Type match_type)
+typename T::iterator find_matching_request(T &c, const LLMediaDataClient::Request *request, LLMediaDataClient::Request::Type match_type)
{
for(typename T::iterator iter = c.begin(); iter != c.end(); ++iter)
{
@@ -106,7 +106,7 @@ static typename T::iterator find_matching_request(T &c, const LLMediaDataClient:
}
template <typename T>
-static typename T::iterator find_matching_request(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type)
+typename T::iterator find_matching_request(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type)
{
for(typename T::iterator iter = c.begin(); iter != c.end(); ++iter)
{
@@ -123,7 +123,7 @@ static typename T::iterator find_matching_request(T &c, const LLUUID &id, LLMedi
// to other elements in the container (such as std::vector).
// If the implementation is changed to use a container with this property, this will need to be revisited.
template <typename T>
-static void remove_matching_requests(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type)
+void remove_matching_requests(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type)
{
for(typename T::iterator iter = c.begin(); iter != c.end();)
{
@@ -171,10 +171,10 @@ bool LLMediaDataClient::isEmpty() const
bool LLMediaDataClient::isInQueue(const LLMediaDataClientObject::ptr_t &object)
{
- if(find_matching_request(mQueue, object->getID()) != mQueue.end())
+ if(find_matching_request(mQueue, object->getID(), LLMediaDataClient::Request::ANY) != mQueue.end())
return true;
- if(find_matching_request(mUnQueuedRequests, object->getID()) != mUnQueuedRequests.end())
+ if(find_matching_request(mUnQueuedRequests, object->getID(), LLMediaDataClient::Request::ANY) != mUnQueuedRequests.end())
return true;
return false;
@@ -183,8 +183,8 @@ bool LLMediaDataClient::isInQueue(const LLMediaDataClientObject::ptr_t &object)
void LLMediaDataClient::removeFromQueue(const LLMediaDataClientObject::ptr_t &object)
{
LL_DEBUGS("LLMediaDataClient") << "removing requests matching ID " << object->getID() << LL_ENDL;
- remove_matching_requests(mQueue, object->getID());
- remove_matching_requests(mUnQueuedRequests, object->getID());
+ remove_matching_requests(mQueue, object->getID(), LLMediaDataClient::Request::ANY);
+ remove_matching_requests(mUnQueuedRequests, object->getID(), LLMediaDataClient::Request::ANY);
}
void LLMediaDataClient::startQueueTimer()
@@ -785,7 +785,7 @@ bool LLObjectMediaDataClient::isInQueue(const LLMediaDataClientObject::ptr_t &ob
if(LLMediaDataClient::isInQueue(object))
return true;
- if(find_matching_request(mRoundRobinQueue, object->getID()) != mRoundRobinQueue.end())
+ if(find_matching_request(mRoundRobinQueue, object->getID(), LLMediaDataClient::Request::ANY) != mRoundRobinQueue.end())
return true;
return false;
@@ -796,7 +796,7 @@ void LLObjectMediaDataClient::removeFromQueue(const LLMediaDataClientObject::ptr
// First, call parent impl.
LLMediaDataClient::removeFromQueue(object);
- remove_matching_requests(mRoundRobinQueue, object->getID());
+ remove_matching_requests(mRoundRobinQueue, object->getID(), LLMediaDataClient::Request::ANY);
}
bool LLObjectMediaDataClient::processQueueTimer()
@@ -952,7 +952,7 @@ void LLObjectMediaNavigateClient::enqueue(Request *request)
}
// If there's already a matching request in the queue, remove it.
- request_queue_t::iterator iter = find_matching_request(mQueue, request);
+ request_queue_t::iterator iter = find_matching_request(mQueue, request, LLMediaDataClient::Request::ANY);
if(iter != mQueue.end())
{
LL_DEBUGS("LLMediaDataClient") << "removing matching queued request " << (**iter) << LL_ENDL;
@@ -960,7 +960,7 @@ void LLObjectMediaNavigateClient::enqueue(Request *request)
}
else
{
- request_set_t::iterator set_iter = find_matching_request(mUnQueuedRequests, request);
+ request_set_t::iterator set_iter = find_matching_request(mUnQueuedRequests, request, LLMediaDataClient::Request::ANY);
if(set_iter != mUnQueuedRequests.end())
{
LL_DEBUGS("LLMediaDataClient") << "removing matching unqueued request " << (**set_iter) << LL_ENDL;
diff --git a/indra/newview/llmediadataclient.h b/indra/newview/llmediadataclient.h
index 231b883c32..80dd519812 100755
--- a/indra/newview/llmediadataclient.h
+++ b/indra/newview/llmediadataclient.h
@@ -281,10 +281,9 @@ private:
bool mQueueTimerIsRunning;
- template <typename T> friend typename T::iterator find_matching_request(T &c, const LLMediaDataClient::Request *request, LLMediaDataClient::Request::Type match_type = LLMediaDataClient::Request::ANY);
- template <typename T> friend typename T::iterator find_matching_request(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type = LLMediaDataClient::Request::ANY);
- template <typename T> friend void remove_matching_requests(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type = LLMediaDataClient::Request::ANY);
-
+ template <typename T> friend typename T::iterator find_matching_request(T &c, const LLMediaDataClient::Request *request, LLMediaDataClient::Request::Type match_type);
+ template <typename T> friend typename T::iterator find_matching_request(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type);
+ template <typename T> friend void remove_matching_requests(T &c, const LLUUID &id, LLMediaDataClient::Request::Type match_type);
};
// MediaDataClient specific for the ObjectMedia cap
diff --git a/indra/newview/llmorphview.cpp b/indra/newview/llmorphview.cpp
index 252d1b78ea..ff86400a56 100755
--- a/indra/newview/llmorphview.cpp
+++ b/indra/newview/llmorphview.cpp
@@ -47,17 +47,8 @@
LLMorphView *gMorphView = NULL;
-
-const F32 EDIT_AVATAR_ORBIT_SPEED = 0.1f;
-const F32 EDIT_AVATAR_MAX_CAMERA_PITCH = 0.5f;
-
-const F32 CAMERA_MOVE_TIME = 0.5f;
const F32 MORPH_NEAR_CLIP = 0.1f;
-const F32 CAMERA_DIST_MIN = 0.4f;
-const F32 CAMERA_DIST_MAX = 4.0f;
-const F32 CAMERA_DIST_STEP = 1.5f;
-
//-----------------------------------------------------------------------------
// LLMorphView()
//-----------------------------------------------------------------------------
diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp
index 1685a18e26..d7e7f13e87 100755
--- a/indra/newview/llnetmap.cpp
+++ b/indra/newview/llnetmap.cpp
@@ -67,7 +67,6 @@ const F32 LLNetMap::MAP_SCALE_MIN = 32;
const F32 LLNetMap::MAP_SCALE_MID = 1024;
const F32 LLNetMap::MAP_SCALE_MAX = 4096;
-const F32 MAP_SCALE_INCREMENT = 16;
const F32 MAP_SCALE_ZOOM_FACTOR = 1.04f; // Zoom in factor per click of scroll wheel (4%)
const F32 MIN_DOT_RADIUS = 3.5f;
const F32 DOT_SCALE = 0.75f;
@@ -210,7 +209,7 @@ void LLNetMap::draw()
}
// figure out where agent is
- S32 region_width = llround(LLWorld::getInstance()->getRegionWidthInMeters());
+ S32 region_width = ll_round(LLWorld::getInstance()->getRegionWidthInMeters());
for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
@@ -381,8 +380,8 @@ void LLNetMap::draw()
(pos_map.mV[VX] >= getRect().getWidth()) ||
(pos_map.mV[VY] >= getRect().getHeight()) )
{
- S32 x = llround( pos_map.mV[VX] );
- S32 y = llround( pos_map.mV[VY] );
+ S32 x = ll_round( pos_map.mV[VX] );
+ S32 y = ll_round( pos_map.mV[VY] );
LLWorldMapView::drawTrackingCircle( getRect(), x, y, color, 1, 10);
} else
{
@@ -422,12 +421,12 @@ void LLNetMap::draw()
// Draw dot for self avatar position
LLVector3d pos_global = gAgent.getPositionGlobal();
pos_map = globalPosToView(pos_global);
- S32 dot_width = llround(mDotRadius * 2.f);
+ S32 dot_width = ll_round(mDotRadius * 2.f);
LLUIImagePtr you = LLWorldMapView::sAvatarYouLargeImage;
if (you)
{
- you->draw(llround(pos_map.mV[VX] - mDotRadius),
- llround(pos_map.mV[VY] - mDotRadius),
+ you->draw(ll_round(pos_map.mV[VX] - mDotRadius),
+ ll_round(pos_map.mV[VY] - mDotRadius),
dot_width,
dot_width);
@@ -531,8 +530,8 @@ void LLNetMap::drawTracking(const LLVector3d& pos_global, const LLColor4& color,
{
if (draw_arrow)
{
- S32 x = llround( pos_local.mV[VX] );
- S32 y = llround( pos_local.mV[VY] );
+ S32 x = ll_round( pos_local.mV[VX] );
+ S32 y = ll_round( pos_local.mV[VY] );
LLWorldMapView::drawTrackingCircle( getRect(), x, y, color, 1, 10 );
LLWorldMapView::drawTrackingArrow( getRect(), x, y, color );
}
@@ -548,8 +547,8 @@ void LLNetMap::drawTracking(const LLVector3d& pos_global, const LLColor4& color,
LLVector3d LLNetMap::viewPosToGlobal( S32 x, S32 y )
{
- x -= llround(getRect().getWidth() / 2 + mCurPan.mV[VX]);
- y -= llround(getRect().getHeight() / 2 + mCurPan.mV[VY]);
+ x -= ll_round(getRect().getWidth() / 2 + mCurPan.mV[VX]);
+ y -= ll_round(getRect().getHeight() / 2 + mCurPan.mV[VY]);
LLVector3 pos_local( (F32)x, (F32)y, 0 );
@@ -685,7 +684,7 @@ void LLNetMap::renderScaledPointGlobal( const LLVector3d& pos, const LLColor4U &
LLVector3 local_pos;
local_pos.setVec( pos - mObjectImageCenterGlobal );
- S32 diameter_pixels = llround(2 * radius_meters * mObjectMapTPM);
+ S32 diameter_pixels = ll_round(2 * radius_meters * mObjectMapTPM);
renderPoint( local_pos, color, diameter_pixels );
}
@@ -701,8 +700,8 @@ void LLNetMap::renderPoint(const LLVector3 &pos_local, const LLColor4U &color,
const S32 image_width = (S32)mObjectImagep->getWidth();
const S32 image_height = (S32)mObjectImagep->getHeight();
- S32 x_offset = llround(pos_local.mV[VX] * mObjectMapTPM + image_width / 2);
- S32 y_offset = llround(pos_local.mV[VY] * mObjectMapTPM + image_height / 2);
+ S32 x_offset = ll_round(pos_local.mV[VX] * mObjectMapTPM + image_width / 2);
+ S32 y_offset = ll_round(pos_local.mV[VY] * mObjectMapTPM + image_height / 2);
if ((x_offset < 0) || (x_offset >= image_width))
{
@@ -781,7 +780,7 @@ void LLNetMap::createObjectImage()
// ... which is, the diagonal of the rect.
F32 width = (F32)getRect().getWidth();
F32 height = (F32)getRect().getHeight();
- S32 square_size = llround( sqrt(width*width + height*height) );
+ S32 square_size = ll_round( sqrt(width*width + height*height) );
// Find the least power of two >= the minimum size.
const S32 MIN_SIZE = 64;
diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp
index 3cd39d7c7e..878f1af9ef 100755
--- a/indra/newview/llpanelclassified.cpp
+++ b/indra/newview/llpanelclassified.cpp
@@ -462,9 +462,9 @@ std::string LLPanelClassifiedInfo::createLocationText(
if (!pos_global.isNull())
{
- S32 region_x = llround((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS;
- S32 region_y = llround((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS;
- S32 region_z = llround((F32)pos_global.mdV[VZ]);
+ S32 region_x = ll_round((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS;
+ S32 region_y = ll_round((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS;
+ S32 region_z = ll_round((F32)pos_global.mdV[VZ]);
location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z));
}
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index e3be1312e4..cc8b7d2a52 100755
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -77,8 +77,6 @@ const S32 MATMEDIA_MEDIA = 1; // Media
const S32 MATTYPE_DIFFUSE = 0; // Diffuse material texture
const S32 MATTYPE_NORMAL = 1; // Normal map
const S32 MATTYPE_SPECULAR = 2; // Specular map
-const S32 ALPHAMODE_NONE = 0; // No alpha mask applied
-const S32 ALPHAMODE_BLEND = 1; // Alpha blending mode
const S32 ALPHAMODE_MASK = 2; // Alpha masking mode
const S32 BUMPY_TEXTURE = 18; // use supplied normal map
const S32 SHINY_TEXTURE = 4; // use supplied specular map
@@ -1848,6 +1846,8 @@ void LLPanelFace::onCancelNormalTexture(const LLSD& data)
U8 bumpy = 0;
bool identical_bumpy = false;
LLSelectedTE::getBumpmap(bumpy, identical_bumpy);
+ LLUUID spec_map_id = getChild<LLTextureCtrl>("bumpytexture control")->getImageAssetID();
+ bumpy = spec_map_id.isNull() ? bumpy : BUMPY_TEXTURE;
sendBump(bumpy);
}
diff --git a/indra/newview/llpanelgroupbulk.cpp b/indra/newview/llpanelgroupbulk.cpp
index 1eafc5bd64..76792cc6fd 100644
--- a/indra/newview/llpanelgroupbulk.cpp
+++ b/indra/newview/llpanelgroupbulk.cpp
@@ -387,7 +387,7 @@ void LLPanelGroupBulk::addUsers(uuid_vec_t& agent_ids)
}
else
{
- llwarns << "llPanelGroupBulk: Selected avatar has no name: " << dest->getID() << llendl;
+ LL_WARNS() << "llPanelGroupBulk: Selected avatar has no name: " << dest->getID() << LL_ENDL;
names.push_back("(Unknown)");
}
}
diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp
index 236ad861a5..e662a05dfc 100755
--- a/indra/newview/llpanelgroupinvite.cpp
+++ b/indra/newview/llpanelgroupinvite.cpp
@@ -492,7 +492,7 @@ void LLPanelGroupInvite::addUsers(uuid_vec_t& agent_ids)
}
else
{
- llwarns << "llPanelGroupInvite: Selected avatar has no name: " << dest->getID() << llendl;
+ LL_WARNS() << "llPanelGroupInvite: Selected avatar has no name: " << dest->getID() << LL_ENDL;
names.push_back("(Unknown)");
}
}
diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp
index 375c54479d..7f82eecdb0 100755
--- a/indra/newview/llpanelgrouplandmoney.cpp
+++ b/indra/newview/llpanelgrouplandmoney.cpp
@@ -473,8 +473,8 @@ void LLPanelGroupLandMoney::impl::processGroupLand(LLMessageSystem* msg)
land_type = LLTrans::getString("land_type_unknown");
}
- S32 region_x = llround(global_x) % REGION_WIDTH_UNITS;
- S32 region_y = llround(global_y) % REGION_WIDTH_UNITS;
+ S32 region_x = ll_round(global_x) % REGION_WIDTH_UNITS;
+ S32 region_y = ll_round(global_y) % REGION_WIDTH_UNITS;
std::string location = sim_name + llformat(" (%d, %d)", region_x, region_y);
std::string area;
committed+=billable_area;
diff --git a/indra/newview/llpanellandaudio.h b/indra/newview/llpanellandaudio.h
index 32a45100f4..7e4fce80e4 100755
--- a/indra/newview/llpanellandaudio.h
+++ b/indra/newview/llpanellandaudio.h
@@ -51,7 +51,6 @@ private:
LLCheckBoxCtrl* mCheckEstateDisabledVoice;
LLCheckBoxCtrl* mCheckParcelVoiceLocal;
LLLineEditor* mMusicURLEdit;
- LLCheckBoxCtrl* mMusicUrlCheck;
LLCheckBoxCtrl* mCheckAVSoundAny;
LLCheckBoxCtrl* mCheckAVSoundGroup;
diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp
index 63ddc05037..a660cb3b21 100755
--- a/indra/newview/llpanellandmarkinfo.cpp
+++ b/indra/newview/llpanellandmarkinfo.cpp
@@ -131,9 +131,9 @@ void LLPanelLandmarkInfo::setInfoType(EInfoType type)
if (name.empty())
{
- S32 region_x = llround(agent_pos.mV[VX]);
- S32 region_y = llround(agent_pos.mV[VY]);
- S32 region_z = llround(agent_pos.mV[VZ]);
+ S32 region_x = ll_round(agent_pos.mV[VX]);
+ S32 region_y = ll_round(agent_pos.mV[VY]);
+ S32 region_z = ll_round(agent_pos.mV[VZ]);
std::string region_name;
LLViewerRegion* region = parcel_mgr->getSelectionRegion();
diff --git a/indra/newview/llpanellandmedia.h b/indra/newview/llpanellandmedia.h
index 0e6292a25e..63cfa01470 100755
--- a/indra/newview/llpanellandmedia.h
+++ b/indra/newview/llpanellandmedia.h
@@ -59,12 +59,10 @@ private:
LLButton* mSetURLButton;
LLSpinCtrl* mMediaHeightCtrl;
LLSpinCtrl* mMediaWidthCtrl;
- LLTextBox* mMediaResetCtrlLabel;
LLTextBox* mMediaSizeCtrlLabel;
LLTextureCtrl* mMediaTextureCtrl;
LLCheckBoxCtrl* mMediaAutoScaleCheck;
LLCheckBoxCtrl* mMediaLoopCheck;
- LLCheckBoxCtrl* mMediaUrlCheck;
LLHandle<LLFloater> mURLEntryFloater;
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index bbc3b85bf0..dd61929f35 100755
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -75,9 +75,6 @@
#include "llsdserialize.h"
-const S32 BLACK_BORDER_HEIGHT = 160;
-const S32 MAX_PASSWORD = 16;
-
LLPanelLogin *LLPanelLogin::sInstance = NULL;
BOOL LLPanelLogin::sCapslockDidNotification = FALSE;
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index a7c9dbdf7b..37273a7793 100755
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -153,7 +153,9 @@ BOOL LLPanelMainInventory::postBuild()
recent_items_panel->setSinceLogoff(TRUE);
recent_items_panel->setSortOrder(LLInventoryFilter::SO_DATE);
recent_items_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
- recent_items_panel->getFilter().markDefault();
+ LLInventoryFilter& recent_filter = recent_items_panel->getFilter();
+ recent_filter.setFilterObjectTypes(recent_filter.getFilterObjectTypes() & ~(0x1 << LLInventoryType::IT_CATEGORY));
+ recent_filter.markDefault();
recent_items_panel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, recent_items_panel, _1, _2));
}
@@ -246,7 +248,7 @@ LLPanelMainInventory::~LLPanelMainInventory( void )
llofstream filtersFile(filterSaveName.str());
if(!LLSDSerialize::toPrettyXML(filterRoot, filtersFile))
{
- LL_WARNS() << "Could not write to filters save file " << filterSaveName << LL_ENDL;
+ LL_WARNS() << "Could not write to filters save file " << filterSaveName.str() << LL_ENDL;
}
else
filtersFile.close();
@@ -853,9 +855,9 @@ void LLFloaterInventoryFinder::draw()
filtered_by_all_types = FALSE;
}
- if (!filtered_by_all_types)
+ if (!filtered_by_all_types || (mPanelMainInventory->getPanel()->getFilter().getFilterTypes() & LLInventoryFilter::FILTERTYPE_DATE))
{
- // don't include folders in filter, unless I've selected everything
+ // don't include folders in filter, unless I've selected everything or filtering by date
filter &= ~(0x1 << LLInventoryType::IT_CATEGORY);
}
diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp
index 9123252f4c..ba23e7013d 100755
--- a/indra/newview/llpanelobject.cpp
+++ b/indra/newview/llpanelobject.cpp
@@ -411,9 +411,9 @@ void LLPanelObject::getState( )
LLQuaternion object_rot = objectp->getRotationEdit();
object_rot.getEulerAngles(&(mCurEulerDegrees.mV[VX]), &(mCurEulerDegrees.mV[VY]), &(mCurEulerDegrees.mV[VZ]));
mCurEulerDegrees *= RAD_TO_DEG;
- mCurEulerDegrees.mV[VX] = fmod(llround(mCurEulerDegrees.mV[VX], OBJECT_ROTATION_PRECISION) + 360.f, 360.f);
- mCurEulerDegrees.mV[VY] = fmod(llround(mCurEulerDegrees.mV[VY], OBJECT_ROTATION_PRECISION) + 360.f, 360.f);
- mCurEulerDegrees.mV[VZ] = fmod(llround(mCurEulerDegrees.mV[VZ], OBJECT_ROTATION_PRECISION) + 360.f, 360.f);
+ mCurEulerDegrees.mV[VX] = fmod(ll_round(mCurEulerDegrees.mV[VX], OBJECT_ROTATION_PRECISION) + 360.f, 360.f);
+ mCurEulerDegrees.mV[VY] = fmod(ll_round(mCurEulerDegrees.mV[VY], OBJECT_ROTATION_PRECISION) + 360.f, 360.f);
+ mCurEulerDegrees.mV[VZ] = fmod(ll_round(mCurEulerDegrees.mV[VZ], OBJECT_ROTATION_PRECISION) + 360.f, 360.f);
if (enable_rotate)
{
@@ -1567,9 +1567,9 @@ void LLPanelObject::sendRotation(BOOL btn_down)
if (mObject.isNull()) return;
LLVector3 new_rot(mCtrlRotX->get(), mCtrlRotY->get(), mCtrlRotZ->get());
- new_rot.mV[VX] = llround(new_rot.mV[VX], OBJECT_ROTATION_PRECISION);
- new_rot.mV[VY] = llround(new_rot.mV[VY], OBJECT_ROTATION_PRECISION);
- new_rot.mV[VZ] = llround(new_rot.mV[VZ], OBJECT_ROTATION_PRECISION);
+ new_rot.mV[VX] = ll_round(new_rot.mV[VX], OBJECT_ROTATION_PRECISION);
+ new_rot.mV[VY] = ll_round(new_rot.mV[VY], OBJECT_ROTATION_PRECISION);
+ new_rot.mV[VZ] = ll_round(new_rot.mV[VZ], OBJECT_ROTATION_PRECISION);
// Note: must compare before conversion to radians
LLVector3 delta = new_rot - mCurEulerDegrees;
diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp
index 6b74d90708..6354b5a02b 100755
--- a/indra/newview/llpanelobjectinventory.cpp
+++ b/indra/newview/llpanelobjectinventory.cpp
@@ -698,6 +698,10 @@ void LLTaskInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
if(isItemRenameable())
{
items.push_back(std::string("Task Rename"));
+ if ((flags & FIRST_SELECTED_ITEM) == 0)
+ {
+ disabled_items.push_back(std::string("Task Rename"));
+ }
}
if(isItemRemovable())
{
diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h
index 55eaf74f74..c1d7a134fa 100755
--- a/indra/newview/llpanelpeople.h
+++ b/indra/newview/llpanelpeople.h
@@ -149,7 +149,6 @@ private:
Updater* mFriendListUpdater;
Updater* mNearbyListUpdater;
Updater* mRecentListUpdater;
- Updater* mFacebookListUpdater;
Updater* mButtonsUpdater;
LLHandle< LLFloater > mPicker;
};
diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp
index 44cca21a76..8fa9aac024 100755
--- a/indra/newview/llpanelpick.cpp
+++ b/indra/newview/llpanelpick.cpp
@@ -284,9 +284,9 @@ std::string LLPanelPickInfo::createLocationText(const std::string& owner_name, c
if (!pos_global.isNull())
{
- S32 region_x = llround((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS;
- S32 region_y = llround((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS;
- S32 region_z = llround((F32)pos_global.mdV[VZ]);
+ S32 region_x = ll_round((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS;
+ S32 region_y = ll_round((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS;
+ S32 region_z = ll_round((F32)pos_global.mdV[VZ]);
location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z));
}
return location_text;
diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp
index 4e7c5f6ed2..e62b5a4f1d 100755
--- a/indra/newview/llpanelplaceinfo.cpp
+++ b/indra/newview/llpanelplaceinfo.cpp
@@ -231,15 +231,15 @@ void LLPanelPlaceInfo::processParcelInfo(const LLParcelData& parcel_data)
// If the region position is zero, grab position from the global
if(mPosRegion.isExactlyZero())
{
- region_x = llround(parcel_data.global_x) % REGION_WIDTH_UNITS;
- region_y = llround(parcel_data.global_y) % REGION_WIDTH_UNITS;
- region_z = llround(parcel_data.global_z);
+ region_x = ll_round(parcel_data.global_x) % REGION_WIDTH_UNITS;
+ region_y = ll_round(parcel_data.global_y) % REGION_WIDTH_UNITS;
+ region_z = ll_round(parcel_data.global_z);
}
else
{
- region_x = llround(mPosRegion.mV[VX]);
- region_y = llround(mPosRegion.mV[VY]);
- region_z = llround(mPosRegion.mV[VZ]);
+ region_x = ll_round(mPosRegion.mV[VX]);
+ region_y = ll_round(mPosRegion.mV[VY]);
+ region_z = ll_round(mPosRegion.mV[VZ]);
}
if (!parcel_data.name.empty())
diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp
index ed91d277dd..e853b2d050 100755
--- a/indra/newview/llpanelplaceprofile.cpp
+++ b/indra/newview/llpanelplaceprofile.cpp
@@ -551,7 +551,7 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel,
// Can't have more than region max tasks, regardless of parcel
// object bonus factor.
- S32 primitives = llmin(llround(parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()),
+ S32 primitives = llmin(ll_round(parcel->getMaxPrimCapacity() * parcel->getParcelPrimBonus()),
(S32)region->getMaxTasks());
const U8* available = (U8*)getString("available").c_str();
diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp
index 2be96b9b78..4bcd932d4b 100755
--- a/indra/newview/llpanelplaces.cpp
+++ b/indra/newview/llpanelplaces.cpp
@@ -75,7 +75,6 @@
#include "llviewerwindow.h"
// Constants
-static const S32 LANDMARK_FOLDERS_MENU_WIDTH = 250;
static const F32 PLACE_INFO_UPDATE_INTERVAL = 3.0;
static const std::string AGENT_INFO_TYPE = "agent";
static const std::string CREATE_LANDMARK_INFO_TYPE = "create_landmark";
diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp
index 7c0e448a99..f42df221e4 100755
--- a/indra/newview/llpanelprimmediacontrols.cpp
+++ b/indra/newview/llpanelprimmediacontrols.cpp
@@ -630,12 +630,12 @@ void LLPanelPrimMediaControls::updateShape()
// convert screenspace bbox to pixels (in screen coords)
LLRect window_rect = gViewerWindow->getWorldViewRectScaled();
LLCoordGL screen_min;
- screen_min.mX = llround((F32)window_rect.mLeft + (F32)window_rect.getWidth() * (min.mV[VX] + 1.f) * 0.5f);
- screen_min.mY = llround((F32)window_rect.mBottom + (F32)window_rect.getHeight() * (min.mV[VY] + 1.f) * 0.5f);
+ screen_min.mX = ll_round((F32)window_rect.mLeft + (F32)window_rect.getWidth() * (min.mV[VX] + 1.f) * 0.5f);
+ screen_min.mY = ll_round((F32)window_rect.mBottom + (F32)window_rect.getHeight() * (min.mV[VY] + 1.f) * 0.5f);
LLCoordGL screen_max;
- screen_max.mX = llround((F32)window_rect.mLeft + (F32)window_rect.getWidth() * (max.mV[VX] + 1.f) * 0.5f);
- screen_max.mY = llround((F32)window_rect.mBottom + (F32)window_rect.getHeight() * (max.mV[VY] + 1.f) * 0.5f);
+ screen_max.mX = ll_round((F32)window_rect.mLeft + (F32)window_rect.getWidth() * (max.mV[VX] + 1.f) * 0.5f);
+ screen_max.mY = ll_round((F32)window_rect.mBottom + (F32)window_rect.getHeight() * (max.mV[VY] + 1.f) * 0.5f);
// grow panel so that screenspace bounding box fits inside "media_region" element of panel
LLRect media_panel_rect;
diff --git a/indra/newview/llplacesinventorybridge.h b/indra/newview/llplacesinventorybridge.h
index 07d18d03c5..108991210f 100755
--- a/indra/newview/llplacesinventorybridge.h
+++ b/indra/newview/llplacesinventorybridge.h
@@ -85,6 +85,8 @@ protected:
class LLPlacesInventoryBridgeBuilder : public LLInventoryFolderViewModelBuilder
{
public:
+ LLPlacesInventoryBridgeBuilder() {}
+
/*virtual*/ LLInvFVBridge* createBridge(LLAssetType::EType asset_type,
LLAssetType::EType actual_asset_type,
LLInventoryType::EType inv_type,
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 8eea5ea73e..5415c273e2 100755
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -106,9 +106,6 @@ const std::string DEFAULT_SCRIPT_NAME = "New Script"; // *TODO:Translate?
const std::string DEFAULT_SCRIPT_DESC = "(No Description)"; // *TODO:Translate?
// Description and header information
-
-const S32 MAX_EXPORT_SIZE = 1000;
-
const S32 MAX_HISTORY_COUNT = 10;
const F32 LIVE_HELP_REFRESH_TIME = 1.f;
@@ -663,12 +660,13 @@ void LLScriptEdCore::updateDynamicHelp(BOOL immediate)
LLTextSegmentPtr segment = NULL;
std::vector<LLTextSegmentPtr> selected_segments;
mEditor->getSelectedSegments(selected_segments);
-
+ LLKeywordToken* token;
// try segments in selection range first
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::TT_WORD)
+ token = (*segment_iter)->getToken();
+ if(token && isKeyword(token))
{
segment = *segment_iter;
break;
@@ -679,7 +677,8 @@ void LLScriptEdCore::updateDynamicHelp(BOOL immediate)
if (!segment)
{
const LLTextSegmentPtr test_segment = mEditor->getPreviousSegment();
- if(test_segment->getToken() && test_segment->getToken()->getType() == LLKeywordToken::TT_WORD)
+ token = test_segment->getToken();
+ if(token && isKeyword(token))
{
segment = test_segment;
}
@@ -708,6 +707,24 @@ void LLScriptEdCore::updateDynamicHelp(BOOL immediate)
}
}
+bool LLScriptEdCore::isKeyword(LLKeywordToken* token)
+{
+ switch(token->getType())
+ {
+ case LLKeywordToken::TT_CONSTANT:
+ case LLKeywordToken::TT_CONTROL:
+ case LLKeywordToken::TT_EVENT:
+ case LLKeywordToken::TT_FUNCTION:
+ case LLKeywordToken::TT_SECTION:
+ case LLKeywordToken::TT_TYPE:
+ case LLKeywordToken::TT_WORD:
+ return true;
+
+ default:
+ return false;
+ }
+}
+
void LLScriptEdCore::setHelpPage(const std::string& help_string)
{
LLFloater* help_floater = mLiveHelpHandle.get();
diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h
index 515f277c4a..66727bceee 100755
--- a/indra/newview/llpreviewscript.h
+++ b/indra/newview/llpreviewscript.h
@@ -133,6 +133,7 @@ protected:
void deleteBridges();
void setHelpPage(const std::string& help_string);
void updateDynamicHelp(BOOL immediate = FALSE);
+ bool isKeyword(LLKeywordToken* token);
void addHelpItemToHistory(const std::string& help_string);
static void onErrorList(LLUICtrl*, void* user_data);
diff --git a/indra/newview/llscripteditor.cpp b/indra/newview/llscripteditor.cpp
index 81920562a7..cd3a4dfd11 100644
--- a/indra/newview/llscripteditor.cpp
+++ b/indra/newview/llscripteditor.cpp
@@ -32,7 +32,6 @@
#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");
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index eb3a4c37d9..9e0bd9b6ed 100755
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -99,14 +99,11 @@ LLViewerObject* getSelectedParentObject(LLViewerObject *object) ;
// Consts
//
-const S32 NUM_SELECTION_UNDO_ENTRIES = 200;
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
@@ -1941,7 +1938,7 @@ void LLSelectMgr::selectionSetMedia(U8 media_type, const LLSD &media_data)
llassert(mMediaData.isMap());
const LLTextureEntry *texture_entry = object->getTE(te);
if (!mMediaData.isMap() ||
- (NULL != texture_entry) && !texture_entry->hasMedia() && !mMediaData.has(LLMediaEntry::HOME_URL_KEY))
+ ((NULL != texture_entry) && !texture_entry->hasMedia() && !mMediaData.has(LLMediaEntry::HOME_URL_KEY)))
{
// skip adding/updating media
}
diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h
index cde05a8d9b..440fce07bb 100755
--- a/indra/newview/llsidepanelappearance.h
+++ b/indra/newview/llsidepanelappearance.h
@@ -90,9 +90,6 @@ private:
LLTextBox* mCurrentLookName;
LLTextBox* mOutfitStatus;
- // Used to make sure the user's inventory is in memory.
- LLCurrentlyWornFetchObserver* mFetchWorn;
-
// Search string for filtering landmarks and teleport
// history locations
std::string mFilterSubString;
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index 4970eec636..0e23e2ad10 100755
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -70,10 +70,7 @@ static LLPanelInjector<LLSidepanelInventory> t_inventory("sidepanel_inventory");
static const char * const INBOX_BUTTON_NAME = "inbox_btn";
static const char * const INBOX_LAYOUT_PANEL_NAME = "inbox_layout_panel";
-static const char * const MAIN_INVENTORY_LAYOUT_PANEL_NAME = "main_inventory_layout_panel";
-
static const char * const INVENTORY_LAYOUT_STACK_NAME = "inventory_layout_stack";
-
static const char * const MARKETPLACE_INBOX_PANEL = "marketplace_inbox";
//
diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp
index 3a82233320..728fc69723 100755
--- a/indra/newview/llslurl.cpp
+++ b/indra/newview/llslurl.cpp
@@ -323,9 +323,9 @@ LLSLURL::LLSLURL(const std::string& grid,
{
mGrid = grid;
mRegion = region;
- S32 x = llround( (F32)fmod( position[VX], (F32)REGION_WIDTH_METERS ) );
- S32 y = llround( (F32)fmod( position[VY], (F32)REGION_WIDTH_METERS ) );
- S32 z = llround( (F32)position[VZ] );
+ S32 x = ll_round( (F32)fmod( position[VX], (F32)REGION_WIDTH_METERS ) );
+ S32 y = ll_round( (F32)fmod( position[VY], (F32)REGION_WIDTH_METERS ) );
+ S32 z = ll_round( (F32)position[VZ] );
mType = LOCATION;
mPosition = LLVector3(x, y, z);
}
@@ -379,9 +379,9 @@ std::string LLSLURL::getSLURLString() const
case LOCATION:
{
// lookup the grid
- S32 x = llround( (F32)mPosition[VX] );
- S32 y = llround( (F32)mPosition[VY] );
- S32 z = llround( (F32)mPosition[VZ] );
+ S32 x = ll_round( (F32)mPosition[VX] );
+ S32 y = ll_round( (F32)mPosition[VY] );
+ S32 z = ll_round( (F32)mPosition[VZ] );
return LLGridManager::getInstance()->getSLURLBase(mGrid) +
LLURI::escape(mRegion) + llformat("/%d/%d/%d",x,y,z);
}
@@ -416,9 +416,9 @@ std::string LLSLURL::getLoginString() const
case LOCATION:
unescaped_start << "uri:"
<< mRegion << "&"
- << llround(mPosition[0]) << "&"
- << llround(mPosition[1]) << "&"
- << llround(mPosition[2]);
+ << ll_round(mPosition[0]) << "&"
+ << ll_round(mPosition[1]) << "&"
+ << ll_round(mPosition[2]);
break;
case HOME_LOCATION:
unescaped_start << "home";
@@ -462,9 +462,9 @@ std::string LLSLURL::getLocationString() const
{
return llformat("%s/%d/%d/%d",
mRegion.c_str(),
- (int)llround(mPosition[0]),
- (int)llround(mPosition[1]),
- (int)llround(mPosition[2]));
+ (int)ll_round(mPosition[0]),
+ (int)ll_round(mPosition[1]),
+ (int)ll_round(mPosition[2]));
}
// static
diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp
index 600ebf5914..ee5fd7cb71 100644
--- a/indra/newview/llsnapshotlivepreview.cpp
+++ b/indra/newview/llsnapshotlivepreview.cpp
@@ -177,14 +177,14 @@ void LLSnapshotLivePreview::updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail
if (image_aspect_ratio > window_aspect_ratio)
{
// trim off top and bottom
- S32 new_height = llround((F32)getRect().getWidth() / image_aspect_ratio);
+ S32 new_height = ll_round((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);
+ S32 new_width = ll_round((F32)getRect().getHeight() * image_aspect_ratio);
rect.mLeft += (getRect().getWidth() - new_width) / 2;
rect.mRight -= (getRect().getWidth() - new_width) / 2;
}
@@ -345,9 +345,9 @@ void LLSnapshotLivePreview::draw()
LLLocalClipRect clip(getLocalRect());
{
// draw diagonal stripe with gradient that passes over screen
- S32 x1 = gViewerWindow->getWindowWidthScaled() * llround((clamp_rescale(shine_interp, 0.f, 1.f, -1.f - SHINE_WIDTH, 1.f)));
- S32 x2 = x1 + llround(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH);
- S32 x3 = x2 + llround(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH);
+ S32 x1 = gViewerWindow->getWindowWidthScaled() * ll_round((clamp_rescale(shine_interp, 0.f, 1.f, -1.f - SHINE_WIDTH, 1.f)));
+ S32 x2 = x1 + ll_round(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH);
+ S32 x3 = x2 + ll_round(gViewerWindow->getWindowWidthScaled() * SHINE_WIDTH);
S32 y1 = 0;
S32 y2 = gViewerWindow->getWindowHeightScaled();
@@ -429,7 +429,7 @@ void LLSnapshotLivePreview::draw()
gGL.pushMatrix();
{
LLRect& rect = mImageRect[old_image_index];
- gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom - llround(getRect().getHeight() * 2.f * (fall_interp * fall_interp)), 0.f);
+ gGL.translatef((F32)rect.mLeft, (F32)rect.mBottom - ll_round(getRect().getHeight() * 2.f * (fall_interp * fall_interp)), 0.f);
gGL.rotatef(-45.f * fall_interp, 0.f, 0.f, 1.f);
gGL.begin(LLRender::QUADS);
{
@@ -483,13 +483,13 @@ BOOL LLSnapshotLivePreview::setThumbnailImageSize()
{
// image too wide, shrink to width
mThumbnailWidth = max_width;
- mThumbnailHeight = llround((F32)max_width / aspect_ratio);
+ mThumbnailHeight = ll_round((F32)max_width / aspect_ratio);
}
else
{
// image too tall, shrink to height
mThumbnailHeight = max_height;
- mThumbnailWidth = llround((F32)max_height * aspect_ratio);
+ mThumbnailWidth = ll_round((F32)max_height * aspect_ratio);
}
if (mThumbnailWidth > width || mThumbnailHeight > height)
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 0a8257f42b..5e342099d7 100755
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -1632,7 +1632,7 @@ void pushVertsColorCoded(LLSpatialGroup* group, U32 mask)
{
LLDrawInfo* params = NULL;
- LLColor4 colors[] = {
+ static const LLColor4 colors[] = {
LLColor4::green,
LLColor4::green1,
LLColor4::green2,
diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp
index 89302c3c64..e80756e4de 100755
--- a/indra/newview/llspeakers.cpp
+++ b/indra/newview/llspeakers.cpp
@@ -544,10 +544,18 @@ void LLSpeakerMgr::updateSpeakerList()
LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(session_id);
if (session->isGroupSessionType() && (mSpeakers.size() <= 1))
{
- const F32 load_group_timeout = gSavedSettings.getF32("ChatLoadGroupTimeout");
// For groups, we need to hit the group manager.
// Note: The session uuid and the group uuid are actually one and the same. If that was to change, this will fail.
LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(session_id);
+ F32 large_group_delay = 0.f;
+ if (gdatap)
+ {
+ //This is a viewer-side bandaid for maint-4414 it does not fix the core issue.
+ large_group_delay = (F32)(gdatap->mMemberCount / 5000);
+ }
+
+ const F32 load_group_timeout = gSavedSettings.getF32("ChatLoadGroupTimeout") + large_group_delay;
+
if (!gdatap && (mGetListTime.getElapsedTimeF32() >= load_group_timeout))
{
// Request the data the first time around
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index 7ca38fad03..5c1041e556 100755
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -95,16 +95,11 @@ extern S32 MENU_BAR_HEIGHT;
// TODO: these values ought to be in the XML too
-const S32 MENU_PARCEL_SPACING = 1; // Distance from right of menu item to parcel information
const S32 SIM_STAT_WIDTH = 8;
-const F32 SIM_WARN_FRACTION = 0.75f;
-const F32 SIM_FULL_FRACTION = 0.98f;
const LLColor4 SIM_OK_COLOR(0.f, 1.f, 0.f, 1.f);
const LLColor4 SIM_WARN_COLOR(1.f, 1.f, 0.f, 1.f);
const LLColor4 SIM_FULL_COLOR(1.f, 0.f, 0.f, 1.f);
const F32 ICON_TIMER_EXPIRY = 3.f; // How long the balance and health icons should flash after a change.
-const F32 ICON_FLASH_FREQUENCY = 2.f;
-const S32 TEXT_HEIGHT = 18;
static void onClickVolume(void*);
diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp
index e75af8db53..503dd6747d 100755
--- a/indra/newview/llsurface.cpp
+++ b/indra/newview/llsurface.cpp
@@ -1232,10 +1232,10 @@ BOOL LLSurface::generateWaterTexture(const F32 x, const F32 y,
S32 x_begin, y_begin, x_end, y_end;
- x_begin = llround(x * scale_inv);
- y_begin = llround(y * scale_inv);
- x_end = llround((x + width) * scale_inv);
- y_end = llround((y + width) * scale_inv);
+ x_begin = ll_round(x * scale_inv);
+ y_begin = ll_round(y * scale_inv);
+ x_end = ll_round((x + width) * scale_inv);
+ y_end = ll_round((y + width) * scale_inv);
if (x_end > tex_width)
{
@@ -1283,9 +1283,9 @@ BOOL LLSurface::generateWaterTexture(const F32 x, const F32 y,
// Want non-linear curve for transparency gradient
coloru = MAX_WATER_COLOR;
const F32 frac = 1.f - 2.f/(2.f - (height - WATER_HEIGHT));
- S32 alpha = 64 + llround((255-64)*frac);
+ S32 alpha = 64 + ll_round((255-64)*frac);
- alpha = llmin(llround((F32)MAX_WATER_COLOR.mV[3]), alpha);
+ alpha = llmin(ll_round((F32)MAX_WATER_COLOR.mV[3]), alpha);
alpha = llmax(64, alpha);
coloru.mV[3] = alpha;
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index c12753acb0..3e5b91c8fc 100755
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -72,12 +72,6 @@
#include "llfloaterreg.h"
#include "lllocalbitmaps.h"
-static const S32 HPAD = 4;
-static const S32 VPAD = 4;
-static const S32 LINE = 16;
-static const S32 FOOTER_HEIGHT = 100;
-static const S32 BORDER_PAD = HPAD;
-static const S32 TEXTURE_INVENTORY_PADDING = 30;
static const F32 CONTEXT_CONE_IN_ALPHA = 0.0f;
static const F32 CONTEXT_CONE_OUT_ALPHA = 1.f;
static const F32 CONTEXT_FADE_TIME = 0.08f;
@@ -118,7 +112,7 @@ public:
/*virtual*/ void onClose(bool app_settings);
// New functions
- void setImageID( const LLUUID& image_asset_id);
+ void setImageID( const LLUUID& image_asset_id, bool set_selection = true);
void updateImageStats();
const LLUUID& getAssetID() { return mImageAssetID; }
const LLUUID& findItemID(const LLUUID& asset_id, BOOL copyable_only);
@@ -232,7 +226,7 @@ LLFloaterTexturePicker::~LLFloaterTexturePicker()
{
}
-void LLFloaterTexturePicker::setImageID(const LLUUID& image_id)
+void LLFloaterTexturePicker::setImageID(const LLUUID& image_id, bool set_selection /*=true*/)
{
if( mImageAssetID != image_id && mActive)
{
@@ -253,6 +247,10 @@ void LLFloaterTexturePicker::setImageID(const LLUUID& image_id)
getChild<LLUICtrl>("apply_immediate_check")->setValue(FALSE);
mNoCopyTextureSelected = TRUE;
}
+ }
+
+ if (set_selection)
+ {
mInventoryPanel->setSelection(item_id, TAKE_FOCUS_NO);
}
}
@@ -461,7 +459,10 @@ BOOL LLFloaterTexturePicker::postBuild()
// don't put keyboard focus on selected item, because the selection callback
// will assume that this was user input
- mInventoryPanel->setSelection(findItemID(mImageAssetID, FALSE), TAKE_FOCUS_NO);
+ if(!mImageAssetID.isNull())
+ {
+ mInventoryPanel->setSelection(findItemID(mImageAssetID, FALSE), TAKE_FOCUS_NO);
+ }
}
mModeSelector = getChild<LLRadioGroup>("mode_selection");
@@ -820,7 +821,7 @@ void LLFloaterTexturePicker::onSelectionChange(const std::deque<LLFolderViewItem
{
mNoCopyTextureSelected = TRUE;
}
- setImageID(itemp->getAssetUUID());
+ setImageID(itemp->getAssetUUID(),false);
mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here?
if (user_action && mCanPreview)
{
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index acd4cf2d8d..fab4203ec3 100755
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -340,7 +340,7 @@ private:
// Threads: Ttf
DecodeResponder(LLTextureFetch* fetcher, const LLUUID& id, LLTextureFetchWorker* worker)
- : mFetcher(fetcher), mID(id), mWorker(worker)
+ : mFetcher(fetcher), mID(id)
{
}
@@ -356,7 +356,6 @@ private:
private:
LLTextureFetch* mFetcher;
LLUUID mID;
- LLTextureFetchWorker* mWorker; // debug only (may get deleted from under us, use mFetcher/mID)
};
struct Compare
diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp
index c82894a5cc..0a9453534b 100755
--- a/indra/newview/lltoastalertpanel.cpp
+++ b/indra/newview/lltoastalertpanel.cpp
@@ -48,7 +48,6 @@
const S32 MAX_ALLOWED_MSG_WIDTH = 400;
const F32 DEFAULT_BUTTON_DELAY = 0.5f;
-const S32 MSG_PAD = 8;
/*static*/ LLControlGroup* LLToastAlertPanel::sSettings = NULL;
/*static*/ LLToastAlertPanel::URLLoader* LLToastAlertPanel::sURLLoader;
diff --git a/indra/newview/lltoastgroupnotifypanel.h b/indra/newview/lltoastgroupnotifypanel.h
index 431fd32da2..269c23798c 100755
--- a/indra/newview/lltoastgroupnotifypanel.h
+++ b/indra/newview/lltoastgroupnotifypanel.h
@@ -60,8 +60,6 @@ private:
static const S32 DEFAULT_MESSAGE_MAX_LINE_COUNT;
- LLButton* mSaveInventoryBtn;
-
LLUUID mGroupID;
LLOfferInfo* mInventoryOffer;
};
diff --git a/indra/newview/lltoolbrush.cpp b/indra/newview/lltoolbrush.cpp
index e3eb8ba7af..0a0bfaf58b 100755
--- a/indra/newview/lltoolbrush.cpp
+++ b/indra/newview/lltoolbrush.cpp
@@ -65,8 +65,7 @@ const std::string REGION_BLOCKS_TERRAFORM_MSG = "This region does not allow terr
const S32 LAND_BRUSH_SIZE_COUNT = 3;
const F32 LAND_BRUSH_SIZE[LAND_BRUSH_SIZE_COUNT] = {1.0f, 2.0f, 4.0f};
-const S32 LAND_STEPS = 3;
-const F32 LAND_METERS_PER_SECOND = 1.0f;
+
enum
{
E_LAND_LEVEL = 0,
diff --git a/indra/newview/lltoolcomp.cpp b/indra/newview/lltoolcomp.cpp
index 4bda9072d0..5a63f6e286 100755
--- a/indra/newview/lltoolcomp.cpp
+++ b/indra/newview/lltoolcomp.cpp
@@ -52,14 +52,8 @@
#include "llfloatertools.h"
#include "llviewercontrol.h"
-const S32 BUTTON_HEIGHT = 16;
-const S32 BUTTON_WIDTH_SMALL = 32;
-const S32 BUTTON_WIDTH_BIG = 48;
-const S32 HPAD = 4;
-
extern LLControlGroup gSavedSettings;
-
// we use this in various places instead of NULL
static LLPointer<LLTool> sNullTool(new LLTool(std::string("null"), NULL));
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index 575e5c5c52..e8f6c35662 100755
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -947,8 +947,7 @@ void LLToolDragAndDrop::pick(const LLPickInfo& pick_info)
const S32 item_index = mCurItemIndex;
const EDragAndDropType dad_type = mCargoTypes[item_index];
// Call the right implementation function
- (U32)callMemberFunction(*this,
- LLDragAndDropDictionary::instance().get(dad_type, target))
+ callMemberFunction(*this, LLDragAndDropDictionary::instance().get(dad_type, target))
(hit_obj, hit_face, pick_info.mKeyMask, TRUE);
}
}
@@ -2173,23 +2172,20 @@ EAcceptance LLToolDragAndDrop::dad3dWearCategory(
}
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;
- }
+ 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)
diff --git a/indra/newview/lltoolfocus.cpp b/indra/newview/lltoolfocus.cpp
index 58073d1186..7de91c7757 100755
--- a/indra/newview/lltoolfocus.cpp
+++ b/indra/newview/lltoolfocus.cpp
@@ -61,7 +61,6 @@ BOOL gCameraBtnOrbit = FALSE;
BOOL gCameraBtnPan = FALSE;
const S32 SLOP_RANGE = 4;
-const F32 FOCUS_OFFSET_FACTOR = 1.f;
//
// Camera - shared functionality
diff --git a/indra/newview/lltoolselectland.cpp b/indra/newview/lltoolselectland.cpp
index 44c0cb3124..ff991dc9fd 100755
--- a/indra/newview/lltoolselectland.cpp
+++ b/indra/newview/lltoolselectland.cpp
@@ -219,8 +219,8 @@ void LLToolSelectLand::handleDeselect()
void LLToolSelectLand::roundXY(LLVector3d &vec)
{
- vec.mdV[VX] = llround( vec.mdV[VX], (F64)PARCEL_GRID_STEP_METERS );
- vec.mdV[VY] = llround( vec.mdV[VY], (F64)PARCEL_GRID_STEP_METERS );
+ vec.mdV[VX] = ll_round( vec.mdV[VX], (F64)PARCEL_GRID_STEP_METERS );
+ vec.mdV[VY] = ll_round( vec.mdV[VY], (F64)PARCEL_GRID_STEP_METERS );
}
diff --git a/indra/newview/lltwitterconnect.cpp b/indra/newview/lltwitterconnect.cpp
index 7088558b83..e983bc883f 100644
--- a/indra/newview/lltwitterconnect.cpp
+++ b/indra/newview/lltwitterconnect.cpp
@@ -397,7 +397,7 @@ void LLTwitterConnect::uploadPhoto(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;
}
diff --git a/indra/newview/llversioninfo.cpp b/indra/newview/llversioninfo.cpp
index 6a8fad0134..5cc7d7bed3 100755
--- a/indra/newview/llversioninfo.cpp
+++ b/indra/newview/llversioninfo.cpp
@@ -38,8 +38,6 @@
#error "Channel or Version information is undefined"
#endif
-const char * const LL_CHANNEL = LL_VIEWER_CHANNEL;
-
//
// Set the version numbers in indra/VIEWER_VERSION
//
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index 5020518454..c6eae68083 100755
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -167,11 +167,6 @@ static bool handleRenderPerfTestChanged(const LLSD& newvalue)
return true;
}
-bool handleRenderAvatarComplexityLimitChanged(const LLSD& newvalue)
-{
- return true;
-}
-
bool handleRenderTransparentWaterChanged(const LLSD& newvalue)
{
LLWorld::getInstance()->updateWaterObjects();
@@ -636,7 +631,6 @@ void settings_setup_listeners()
gSavedSettings.getControl("WindLightUseAtmosShaders")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
gSavedSettings.getControl("RenderGammaFull")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
gSavedSettings.getControl("RenderAvatarMaxVisible")->getSignal()->connect(boost::bind(&handleAvatarMaxVisibleChanged, _2));
- gSavedSettings.getControl("RenderAvatarComplexityLimit")->getSignal()->connect(boost::bind(&handleRenderAvatarComplexityLimitChanged, _2));
gSavedSettings.getControl("RenderVolumeLODFactor")->getSignal()->connect(boost::bind(&handleVolumeLODChanged, _2));
gSavedSettings.getControl("RenderAvatarLODFactor")->getSignal()->connect(boost::bind(&handleAvatarLODChanged, _2));
gSavedSettings.getControl("RenderAvatarPhysicsLODFactor")->getSignal()->connect(boost::bind(&handleAvatarPhysicsLODChanged, _2));
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 981e4c40aa..cd9b2ed11b 100755
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -1176,8 +1176,8 @@ LLRect get_whole_screen_region()
if (zoom_factor > 1.f)
{
S32 num_horizontal_tiles = llceil(zoom_factor);
- S32 tile_width = llround((F32)gViewerWindow->getWorldViewWidthScaled() / zoom_factor);
- S32 tile_height = llround((F32)gViewerWindow->getWorldViewHeightScaled() / zoom_factor);
+ S32 tile_width = ll_round((F32)gViewerWindow->getWorldViewWidthScaled() / zoom_factor);
+ S32 tile_height = ll_round((F32)gViewerWindow->getWorldViewHeightScaled() / zoom_factor);
int tile_y = sub_region / num_horizontal_tiles;
int tile_x = sub_region - (tile_y * num_horizontal_tiles);
@@ -1471,8 +1471,8 @@ void render_ui_2d()
int pos_y = sub_region / llceil(zoom_factor);
int pos_x = sub_region - (pos_y*llceil(zoom_factor));
// offset for this tile
- LLFontGL::sCurOrigin.mX -= llround((F32)gViewerWindow->getWindowWidthScaled() * (F32)pos_x / zoom_factor);
- LLFontGL::sCurOrigin.mY -= llround((F32)gViewerWindow->getWindowHeightScaled() * (F32)pos_y / zoom_factor);
+ LLFontGL::sCurOrigin.mX -= ll_round((F32)gViewerWindow->getWindowWidthScaled() * (F32)pos_x / zoom_factor);
+ LLFontGL::sCurOrigin.mY -= ll_round((F32)gViewerWindow->getWindowHeightScaled() * (F32)pos_y / zoom_factor);
}
stop_glerror();
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index d364fce45a..d6c8ba10f6 100755
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -1456,7 +1456,8 @@ void update_inventory_category(
void remove_inventory_items(
LLInventoryObject::object_list_t& items_to_kill,
- LLPointer<LLInventoryCallback> cb)
+ LLPointer<LLInventoryCallback> cb
+ )
{
for (LLInventoryObject::object_list_t::iterator it = items_to_kill.begin();
it != items_to_kill.end();
@@ -1468,12 +1469,13 @@ void remove_inventory_items(
void remove_inventory_item(
const LLUUID& item_id,
- LLPointer<LLInventoryCallback> cb)
+ LLPointer<LLInventoryCallback> cb,
+ bool immediate_delete)
{
LLPointer<LLInventoryObject> obj = gInventory.getItem(item_id);
if (obj)
{
- remove_inventory_item(obj, cb);
+ remove_inventory_item(obj, cb, immediate_delete);
}
else
{
@@ -1483,7 +1485,8 @@ void remove_inventory_item(
void remove_inventory_item(
LLPointer<LLInventoryObject> obj,
- LLPointer<LLInventoryCallback> cb)
+ LLPointer<LLInventoryCallback> cb,
+ bool immediate_delete)
{
if(obj)
{
@@ -1493,6 +1496,11 @@ void remove_inventory_item(
{
LLPointer<AISCommand> cmd_ptr = new RemoveItemCommand(item_id, cb);
cmd_ptr->run_command();
+
+ if (immediate_delete)
+ {
+ gInventory.onObjectDeletedFromServer(item_id);
+ }
}
else // no cap
{
diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h
index d345c49cfb..ca92565600 100755
--- a/indra/newview/llviewerinventory.h
+++ b/indra/newview/llviewerinventory.h
@@ -394,11 +394,13 @@ void remove_inventory_items(
void remove_inventory_item(
LLPointer<LLInventoryObject> obj,
- LLPointer<LLInventoryCallback> cb);
+ LLPointer<LLInventoryCallback> cb,
+ bool immediate_delete = false);
void remove_inventory_item(
const LLUUID& item_id,
- LLPointer<LLInventoryCallback> cb);
+ LLPointer<LLInventoryCallback> cb,
+ bool immediate_delete = false);
void remove_inventory_category(
const LLUUID& cat_id,
diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp
index b0f4802e20..9b8c913c6b 100755
--- a/indra/newview/llviewerkeyboard.cpp
+++ b/indra/newview/llviewerkeyboard.cpp
@@ -53,7 +53,6 @@ const F32 FLY_FRAMES = 4;
const F32 NUDGE_TIME = 0.25f; // in seconds
const S32 NUDGE_FRAMES = 2;
const F32 ORBIT_NUDGE_RATE = 0.05f; // fraction of normal speed
-const F32 YAW_NUDGE_RATE = 0.05f; // fraction of normal speed
struct LLKeyboardActionRegistry
: public LLRegistrySingleton<std::string, boost::function<void (EKeystate keystate)>, LLKeyboardActionRegistry>
@@ -66,7 +65,7 @@ void agent_jump( EKeystate s )
{
if( KEYSTATE_UP == s ) return;
F32 time = gKeyboard->getCurKeyElapsedTime();
- S32 frame_count = llround(gKeyboard->getCurKeyElapsedFrameCount());
+ S32 frame_count = ll_round(gKeyboard->getCurKeyElapsedFrameCount());
if( time < FLY_TIME
|| frame_count <= FLY_FRAMES
@@ -88,18 +87,25 @@ void agent_push_down( EKeystate s )
gAgent.moveUp(-1);
}
+static void agent_check_temporary_run(LLAgent::EDoubleTapRunMode mode)
+{
+ if (gAgent.mDoubleTapRunMode == mode &&
+ gAgent.getRunning() &&
+ !gAgent.getAlwaysRun())
+ {
+ // Turn off temporary running.
+ gAgent.clearRunning();
+ gAgent.sendWalkRun(gAgent.getRunning());
+ }
+}
+
static void agent_handle_doubletap_run(EKeystate s, LLAgent::EDoubleTapRunMode mode)
{
if (KEYSTATE_UP == s)
{
- if (gAgent.mDoubleTapRunMode == mode &&
- gAgent.getRunning() &&
- !gAgent.getAlwaysRun())
- {
- // Turn off temporary running.
- gAgent.clearRunning();
- gAgent.sendWalkRun(gAgent.getRunning());
- }
+ // Note: in case shift is already released, slide left/right run
+ // will be released in agent_turn_left()/agent_turn_right()
+ agent_check_temporary_run(mode);
}
else if (gSavedSettings.getBOOL("AllowTapTapHoldRun") &&
KEYSTATE_DOWN == s &&
@@ -126,7 +132,7 @@ static void agent_push_forwardbackward( EKeystate s, S32 direction, LLAgent::EDo
if (KEYSTATE_UP == s) return;
F32 time = gKeyboard->getCurKeyElapsedTime();
- S32 frame_count = llround(gKeyboard->getCurKeyElapsedFrameCount());
+ S32 frame_count = ll_round(gKeyboard->getCurKeyElapsedFrameCount());
if( time < NUDGE_TIME || frame_count <= NUDGE_FRAMES)
{
@@ -177,7 +183,7 @@ static void agent_slide_leftright( EKeystate s, S32 direction, LLAgent::EDoubleT
agent_handle_doubletap_run(s, mode);
if( KEYSTATE_UP == s ) return;
F32 time = gKeyboard->getCurKeyElapsedTime();
- S32 frame_count = llround(gKeyboard->getCurKeyElapsedFrameCount());
+ S32 frame_count = ll_round(gKeyboard->getCurKeyElapsedFrameCount());
if( time < NUDGE_TIME || frame_count <= NUDGE_FRAMES)
{
@@ -218,7 +224,12 @@ void agent_turn_left( EKeystate s )
}
else
{
- if (KEYSTATE_UP == s) return;
+ if (KEYSTATE_UP == s)
+ {
+ // Check temporary running. In case user released 'left' key with shift already released.
+ agent_check_temporary_run(LLAgent::DOUBLETAP_SLIDELEFT);
+ return;
+ }
F32 time = gKeyboard->getCurKeyElapsedTime();
gAgent.moveYaw( LLFloaterMove::getYawRate( time ) );
}
@@ -241,7 +252,12 @@ void agent_turn_right( EKeystate s )
}
else
{
- if (KEYSTATE_UP == s) return;
+ if (KEYSTATE_UP == s)
+ {
+ // Check temporary running. In case user released 'right' key with shift already released.
+ agent_check_temporary_run(LLAgent::DOUBLETAP_SLIDERIGHT);
+ return;
+ }
F32 time = gKeyboard->getCurKeyElapsedTime();
gAgent.moveYaw( -LLFloaterMove::getYawRate( time ) );
}
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 8499012cfc..a1451d770a 100755
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -924,7 +924,7 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
{
F32 approximate_interest_dimension = (F32) sqrt(pimpl->getInterest());
- pimpl->setLowPrioritySizeLimit(llround(approximate_interest_dimension));
+ pimpl->setLowPrioritySizeLimit(ll_round(approximate_interest_dimension));
}
}
else
@@ -2330,8 +2330,8 @@ void LLViewerMediaImpl::scaleTextureCoords(const LLVector2& texture_coords, S32
texture_y = 1.0 + texture_y;
// scale x and y to texel units.
- *x = llround(texture_x * mMediaSource->getTextureWidth());
- *y = llround((1.0f - texture_y) * mMediaSource->getTextureHeight());
+ *x = ll_round(texture_x * mMediaSource->getTextureWidth());
+ *y = ll_round((1.0f - texture_y) * mMediaSource->getTextureHeight());
// Adjust for the difference between the actual texture height and the amount of the texture in use.
*y -= (mMediaSource->getTextureHeight() - mMediaSource->getHeight());
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 44eb4361f1..762f75edd4 100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -128,10 +128,7 @@ extern void on_new_message(const LLSD& msg);
//
// Constants
//
-const F32 BIRD_AUDIBLE_RADIUS = 32.0f;
-const F32 SIT_DISTANCE_FROM_TARGET = 0.25f;
const F32 CAMERA_POSITION_THRESHOLD_SQUARED = 0.001f * 0.001f;
-static const F32 LOGOUT_REPLY_TIME = 3.f; // Wait this long after LogoutReply before quitting.
// Determine how quickly residents' scripts can issue question dialogs
// Allow bursts of up to 5 dialogs in 10 seconds. 10*2=20 seconds recovery if throttle kicks in
@@ -2411,7 +2408,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
BOOL is_do_not_disturb = gAgent.isDoNotDisturb();
BOOL is_muted = LLMuteList::getInstance()->isMuted(from_id, name, LLMute::flagTextChat)
// object IMs contain sender object id in session_id (STORM-1209)
- || dialog == IM_FROM_TASK && LLMuteList::getInstance()->isMuted(session_id);
+ || (dialog == IM_FROM_TASK && LLMuteList::getInstance()->isMuted(session_id));
BOOL is_owned_by_me = FALSE;
BOOL is_friend = (LLAvatarTracker::instance().getBuddyInfo(from_id) == NULL) ? false : true;
BOOL accept_im_from_only_friend = gSavedSettings.getBOOL("VoiceCallsFriendsOnly");
@@ -5116,7 +5113,7 @@ void process_avatar_sit_response(LLMessageSystem *mesgsys, void **user_data)
if (object)
{
LLVector3 sit_spot = object->getPositionAgent() + (sitPosition * object->getRotation());
- if (!use_autopilot || isAgentAvatarValid() && gAgentAvatarp->isSitting() && gAgentAvatarp->getRoot() == object->getRoot())
+ if (!use_autopilot || (isAgentAvatarValid() && gAgentAvatarp->isSitting() && gAgentAvatarp->getRoot() == object->getRoot()))
{
//we're already sitting on this object, so don't autopilot
}
@@ -7117,8 +7114,6 @@ void process_user_info_reply(LLMessageSystem* msg, void**)
//---------------------------------------------------------------------------
const S32 SCRIPT_DIALOG_MAX_BUTTONS = 12;
-const S32 SCRIPT_DIALOG_BUTTON_STR_SIZE = 24;
-const S32 SCRIPT_DIALOG_MAX_MESSAGE_SIZE = 512;
const char* SCRIPT_DIALOG_HEADER = "Script Dialog:\n";
bool callback_script_dialog(const LLSD& notification, const LLSD& response)
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 2f6283c8d0..7cdf6a79b7 100755
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -359,10 +359,17 @@ void LLViewerObject::markDead()
//LL_INFOS() << "Marking self " << mLocalID << " as dead." << LL_ENDL;
// Root object of this hierarchy unlinks itself.
+ LLVOAvatar *av = getAvatarAncestor();
if (getParent())
{
((LLViewerObject *)getParent())->removeChild(this);
}
+ LLUUID mesh_id;
+ if (av && LLVOAvatar::getRiggedMeshID(this,mesh_id))
+ {
+ // This case is needed for indirectly attached mesh objects.
+ av->resetJointPositionsOnDetach(mesh_id);
+ }
// Mark itself as dead
mDead = TRUE;
@@ -2274,7 +2281,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
}
}
- if ((new_rot != getRotation())
+ if ((new_rot.isNotEqualEps(getRotation(), F_ALMOST_ZERO))
|| (new_angv != old_angv))
{
if (new_rot != mPreviousRotation)
@@ -5011,6 +5018,22 @@ LLVOAvatar* LLViewerObject::asAvatar()
return NULL;
}
+// If this object is directly or indirectly parented by an avatar, return it.
+LLVOAvatar* LLViewerObject::getAvatarAncestor()
+{
+ LLViewerObject *pobj = (LLViewerObject*) getParent();
+ while (pobj)
+ {
+ LLVOAvatar *av = pobj->asAvatar();
+ if (av)
+ {
+ return av;
+ }
+ pobj = (LLViewerObject*) pobj->getParent();
+ }
+ return NULL;
+}
+
BOOL LLViewerObject::isParticleSource() const
{
return !mPartSourcep.isNull() && !mPartSourcep->isDead();
@@ -6198,6 +6221,17 @@ const LLUUID &LLViewerObject::extractAttachmentItemID()
return getAttachmentItemID();
}
+const std::string& LLViewerObject::getAttachmentItemName()
+{
+ static std::string empty;
+ LLInventoryItem *item = gInventory.getItem(getAttachmentItemID());
+ if (isAttachment() && item)
+ {
+ return item->getName();
+ }
+ return empty;
+}
+
//virtual
LLVOAvatar* LLViewerObject::getAvatar() const
{
diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h
index e7ae0af32a..fe020a3270 100755
--- a/indra/newview/llviewerobject.h
+++ b/indra/newview/llviewerobject.h
@@ -135,6 +135,8 @@ public:
virtual LLVOAvatar* asAvatar();
+ LLVOAvatar* getAvatarAncestor();
+
static void initVOClasses();
static void cleanupVOClasses();
@@ -170,6 +172,8 @@ public:
void setOnActiveList(BOOL on_active) { mOnActiveList = on_active; }
virtual BOOL isAttachment() const { return FALSE; }
+ const std::string& getAttachmentItemName();
+
virtual LLVOAvatar* getAvatar() const; //get the avatar this object is attached to, or NULL if object is not an attachment
virtual BOOL isHUDAttachment() const { return FALSE; }
virtual BOOL isTempAttachment() const;
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index 7c94442f09..e85d8198aa 100755
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -281,7 +281,7 @@ S32 LLViewerParcelMgr::getSelectedArea() const
F64 width = mEastNorth.mdV[VX] - mWestSouth.mdV[VX];
F64 height = mEastNorth.mdV[VY] - mWestSouth.mdV[VY];
F32 area = (F32)(width * height);
- rv = llround(area);
+ rv = ll_round(area);
}
return rv;
}
@@ -301,10 +301,10 @@ void LLViewerParcelMgr::writeHighlightSegments(F32 west, F32 south, F32 east,
F32 north)
{
S32 x, y;
- S32 min_x = llround( west / PARCEL_GRID_STEP_METERS );
- S32 max_x = llround( east / PARCEL_GRID_STEP_METERS );
- S32 min_y = llround( south / PARCEL_GRID_STEP_METERS );
- S32 max_y = llround( north / PARCEL_GRID_STEP_METERS );
+ S32 min_x = ll_round( west / PARCEL_GRID_STEP_METERS );
+ S32 max_x = ll_round( east / PARCEL_GRID_STEP_METERS );
+ S32 min_y = ll_round( south / PARCEL_GRID_STEP_METERS );
+ S32 max_y = ll_round( north / PARCEL_GRID_STEP_METERS );
const S32 STRIDE = mParcelsPerEdge+1;
@@ -416,12 +416,12 @@ LLParcelSelectionHandle LLViewerParcelMgr::selectParcelAt(const LLVector3d& pos_
LLVector3d northeast = pos_global;
southwest -= LLVector3d( PARCEL_GRID_STEP_METERS/2, PARCEL_GRID_STEP_METERS/2, 0 );
- southwest.mdV[VX] = llround( southwest.mdV[VX], (F64)PARCEL_GRID_STEP_METERS );
- southwest.mdV[VY] = llround( southwest.mdV[VY], (F64)PARCEL_GRID_STEP_METERS );
+ southwest.mdV[VX] = ll_round( southwest.mdV[VX], (F64)PARCEL_GRID_STEP_METERS );
+ southwest.mdV[VY] = ll_round( southwest.mdV[VY], (F64)PARCEL_GRID_STEP_METERS );
northeast += LLVector3d( PARCEL_GRID_STEP_METERS/2, PARCEL_GRID_STEP_METERS/2, 0 );
- northeast.mdV[VX] = llround( northeast.mdV[VX], (F64)PARCEL_GRID_STEP_METERS );
- northeast.mdV[VY] = llround( northeast.mdV[VY], (F64)PARCEL_GRID_STEP_METERS );
+ northeast.mdV[VX] = ll_round( northeast.mdV[VX], (F64)PARCEL_GRID_STEP_METERS );
+ northeast.mdV[VY] = ll_round( northeast.mdV[VY], (F64)PARCEL_GRID_STEP_METERS );
// Snap to parcel
return selectLand( southwest, northeast, TRUE );
diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp
index 76418ad6a6..230bdca4ef 100755
--- a/indra/newview/llviewerpartsim.cpp
+++ b/indra/newview/llviewerpartsim.cpp
@@ -42,8 +42,6 @@
#include "llvovolume.h"
const F32 PART_SIM_BOX_SIDE = 16.f;
-const F32 PART_SIM_BOX_OFFSET = 0.5f*PART_SIM_BOX_SIDE;
-const F32 PART_SIM_BOX_RAD = 0.5f*F_SQRT3*PART_SIM_BOX_SIDE;
//static
S32 LLViewerPartSim::sMaxParticleCount = 0;
@@ -311,7 +309,6 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt)
if (part->mFlags & LLPartData::LL_PART_WIND_MASK)
{
- LLVector3 tempVel(part->mVelocity);
part->mVelocity *= 1.f - 0.1f*dt;
part->mVelocity += 0.1f*dt*regionp->mWind.getVelocity(regionp->getPosRegionFromAgent(part->mPosAgent));
}
@@ -391,7 +388,7 @@ void LLViewerPartGroup::updateParticles(const F32 lastdt)
}
// Do glow interpolation
- part->mGlow.mV[3] = (U8) llround(lerp(part->mStartGlow, part->mEndGlow, frac)*255.f);
+ part->mGlow.mV[3] = (U8) ll_round(lerp(part->mStartGlow, part->mEndGlow, frac)*255.f);
// Set the last update time to now.
part->mLastUpdateTime = cur_time;
diff --git a/indra/newview/llviewerpartsource.cpp b/indra/newview/llviewerpartsource.cpp
index a7fd2e0fe4..7efa821bbf 100755
--- a/indra/newview/llviewerpartsource.cpp
+++ b/indra/newview/llviewerpartsource.cpp
@@ -313,7 +313,7 @@ void LLViewerPartSourceScript::update(const F32 dt)
part->mStartGlow = mPartSysData.mPartData.mStartGlow;
part->mEndGlow = mPartSysData.mPartData.mEndGlow;
- part->mGlow = LLColor4U(0, 0, 0, (U8) llround(part->mStartGlow*255.f));
+ part->mGlow = LLColor4U(0, 0, 0, (U8) ll_round(part->mStartGlow*255.f));
if (mPartSysData.mPattern & LLPartSysData::LL_PART_SRC_PATTERN_DROP)
{
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 31493ca6ce..af6ff79c61 100755
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -87,8 +87,6 @@
// 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.
// We want to allow for seed cap retry, but its not useful after that 60 seconds.
// Give it 3 chances, each at 18 seconds to give ourselves a few seconds to connect anyways if we give up.
@@ -1923,7 +1921,6 @@ public:
}
else if( i != you_index)
{
- U32 loc = x << 16 | y << 8 | z; loc = loc;
U32 pos = 0x0;
pos |= x;
pos <<= 8;
diff --git a/indra/newview/llviewertexlayer.cpp b/indra/newview/llviewertexlayer.cpp
index 65ba3fb6e5..66e5742911 100755
--- a/indra/newview/llviewertexlayer.cpp
+++ b/indra/newview/llviewertexlayer.cpp
@@ -39,9 +39,6 @@
#include "pipeline.h"
#include "llviewercontrol.h"
-static const S32 BAKE_UPLOAD_ATTEMPTS = 7;
-static const F32 BAKE_UPLOAD_RETRY_DELAY = 2.f; // actual delay grows by power of 2 each attempt
-
// runway consolidate
extern std::string self_av_string();
diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp
index 0c4f55d704..85ae64aeff 100755
--- a/indra/newview/llviewertexteditor.cpp
+++ b/indra/newview/llviewertexteditor.cpp
@@ -169,8 +169,7 @@ public:
mImage(image),
mLabel(utf8str_to_wstring(inv_item->getName())),
mItem(inv_item),
- mEditor(editor),
- mHasMouseHover(false)
+ mEditor(editor)
{
mStyle = new LLStyle(LLStyle::Params().font(LLFontGL::getFontSansSerif()));
@@ -262,8 +261,6 @@ private:
std::string mToolTip;
LLPointer<LLInventoryItem> mItem;
LLTextEditor& mEditor;
- bool mHasMouseHover;
-
};
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 4e2eef39d6..023457c0c8 100755
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -452,7 +452,6 @@ void LLViewerTexture::initClass()
// tuning params
const F32 discard_bias_delta = .25f;
const F32 discard_delta_time = 0.5f;
-const S32 min_non_tex_system_mem = (128<<20); // 128 MB
// non-const (used externally
F32 texmem_lower_bound_scale = 0.85f;
F32 texmem_middle_bound_scale = 0.925f;
diff --git a/indra/newview/llviewertextureanim.cpp b/indra/newview/llviewertextureanim.cpp
index 2b364851a7..9af92d7377 100755
--- a/indra/newview/llviewertextureanim.cpp
+++ b/indra/newview/llviewertextureanim.cpp
@@ -179,7 +179,7 @@ S32 LLViewerTextureAnim::animateTextures(F32 &off_s, F32 &off_t,
if (!(mMode & SMOOTH))
{
- frame_counter = (F32)llround(frame_counter);
+ frame_counter = (F32)ll_round(frame_counter);
}
//
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index b98726900f..8c27ddc63c 100755
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -1258,9 +1258,6 @@ LLPointer<LLImageJ2C> LLViewerTextureList::convertToUploadFile(LLPointer<LLImage
return compressedImage;
}
-const S32 MIN_VIDEO_RAM = 32;
-const S32 MAX_VIDEO_RAM = 512; // 512MB max for performance reasons.
-
// Returns min setting for TextureMemory (in MB)
S32Megabytes LLViewerTextureList::getMinVideoRamSetting()
{
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 9dcd0b81e0..b63222590d 100755
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -898,8 +898,8 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK
const char* buttonstatestr = "";
S32 x = pos.mX;
S32 y = pos.mY;
- x = llround((F32)x / mDisplayScale.mV[VX]);
- y = llround((F32)y / mDisplayScale.mV[VY]);
+ x = ll_round((F32)x / mDisplayScale.mV[VX]);
+ y = ll_round((F32)y / mDisplayScale.mV[VY]);
// only send mouse clicks to UI if UI is visible
if(gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
@@ -1065,8 +1065,8 @@ BOOL LLViewerWindow::handleRightMouseDown(LLWindow *window, LLCoordGL pos, MASK
{
S32 x = pos.mX;
S32 y = pos.mY;
- x = llround((F32)x / mDisplayScale.mV[VX]);
- y = llround((F32)y / mDisplayScale.mV[VY]);
+ x = ll_round((F32)x / mDisplayScale.mV[VX]);
+ y = ll_round((F32)y / mDisplayScale.mV[VY]);
BOOL down = TRUE;
BOOL handle = handleAnyMouseClick(window,pos,mask,LLMouseHandler::CLICK_RIGHT,down);
@@ -1263,8 +1263,8 @@ void LLViewerWindow::handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask
S32 x = pos.mX;
S32 y = pos.mY;
- x = llround((F32)x / mDisplayScale.mV[VX]);
- y = llround((F32)y / mDisplayScale.mV[VY]);
+ x = ll_round((F32)x / mDisplayScale.mV[VX]);
+ y = ll_round((F32)y / mDisplayScale.mV[VY]);
mMouseInWindow = TRUE;
@@ -1722,7 +1722,7 @@ LLViewerWindow::LLViewerWindow(const Params& p)
LLCoordWindow size;
mWindow->getSize(&size);
mWindowRectRaw.set(0, size.mY, size.mX, 0);
- mWindowRectScaled.set(0, llround((F32)size.mY / mDisplayScale.mV[VY]), llround((F32)size.mX / mDisplayScale.mV[VX]), 0);
+ mWindowRectScaled.set(0, ll_round((F32)size.mY / mDisplayScale.mV[VY]), ll_round((F32)size.mX / mDisplayScale.mV[VX]), 0);
}
LLFontManager::initClass();
@@ -2250,8 +2250,8 @@ void LLViewerWindow::reshape(S32 width, S32 height)
LLUI::setScaleFactor(mDisplayScale);
// update our window rectangle
- mWindowRectScaled.mRight = mWindowRectScaled.mLeft + llround((F32)width / mDisplayScale.mV[VX]);
- mWindowRectScaled.mTop = mWindowRectScaled.mBottom + llround((F32)height / mDisplayScale.mV[VY]);
+ mWindowRectScaled.mRight = mWindowRectScaled.mLeft + ll_round((F32)width / mDisplayScale.mV[VX]);
+ mWindowRectScaled.mTop = mWindowRectScaled.mBottom + ll_round((F32)height / mDisplayScale.mV[VY]);
setup2DViewport();
@@ -2444,8 +2444,8 @@ void LLViewerWindow::draw()
microsecondsToTimecodeString(gFrameTime,text);
const LLFontGL* font = LLFontGL::getFontSansSerif();
font->renderUTF8(text, 0,
- llround((getWindowWidthScaled()/2)-100.f),
- llround((getWindowHeightScaled()-60.f)),
+ ll_round((getWindowWidthScaled()/2)-100.f),
+ ll_round((getWindowHeightScaled()-60.f)),
LLColor4( 1.f, 1.f, 1.f, 1.f ),
LLFontGL::LEFT, LLFontGL::TOP);
}
@@ -2521,7 +2521,7 @@ void LLViewerWindow::draw()
const S32 DIST_FROM_TOP = 20;
LLFontGL::getFontSansSerifBig()->renderUTF8(
mOverlayTitle, 0,
- llround( getWindowWidthScaled() * 0.5f),
+ ll_round( getWindowWidthScaled() * 0.5f),
getWindowHeightScaled() - DIST_FROM_TOP,
LLColor4(1, 1, 1, 0.4f),
LLFontGL::HCENTER, LLFontGL::TOP);
@@ -3373,7 +3373,7 @@ void LLViewerWindow::updateMouseDelta()
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));
+ mCurrentMouseDelta.set(ll_round(fdx), ll_round(fdy));
mouse_vel.setVec(fdx,fdy);
}
else
@@ -3488,10 +3488,10 @@ void LLViewerWindow::updateWorldViewRect(bool use_full_window)
new_world_rect.mTop = llmax(new_world_rect.mTop, new_world_rect.mBottom + 1);
new_world_rect.mRight = llmax(new_world_rect.mRight, new_world_rect.mLeft + 1);
- new_world_rect.mLeft = llround((F32)new_world_rect.mLeft * mDisplayScale.mV[VX]);
- new_world_rect.mRight = llround((F32)new_world_rect.mRight * mDisplayScale.mV[VX]);
- new_world_rect.mBottom = llround((F32)new_world_rect.mBottom * mDisplayScale.mV[VY]);
- new_world_rect.mTop = llround((F32)new_world_rect.mTop * mDisplayScale.mV[VY]);
+ new_world_rect.mLeft = ll_round((F32)new_world_rect.mLeft * mDisplayScale.mV[VX]);
+ new_world_rect.mRight = ll_round((F32)new_world_rect.mRight * mDisplayScale.mV[VX]);
+ new_world_rect.mBottom = ll_round((F32)new_world_rect.mBottom * mDisplayScale.mV[VY]);
+ new_world_rect.mTop = ll_round((F32)new_world_rect.mTop * mDisplayScale.mV[VY]);
}
if (mWorldViewRectRaw != new_world_rect)
@@ -5140,10 +5140,10 @@ void LLViewerWindow::calcDisplayScale()
LLRect LLViewerWindow::calcScaledRect(const LLRect & rect, const LLVector2& display_scale)
{
LLRect res = rect;
- res.mLeft = llround((F32)res.mLeft / display_scale.mV[VX]);
- res.mRight = llround((F32)res.mRight / display_scale.mV[VX]);
- res.mBottom = llround((F32)res.mBottom / display_scale.mV[VY]);
- res.mTop = llround((F32)res.mTop / display_scale.mV[VY]);
+ res.mLeft = ll_round((F32)res.mLeft / display_scale.mV[VX]);
+ res.mRight = ll_round((F32)res.mRight / display_scale.mV[VX]);
+ res.mBottom = ll_round((F32)res.mBottom / display_scale.mV[VY]);
+ res.mTop = ll_round((F32)res.mTop / display_scale.mV[VY]);
return res;
}
@@ -5406,8 +5406,8 @@ void LLPickInfo::updateXYCoords()
LLPointer<LLViewerTexture> imagep = LLViewerTextureManager::getFetchedTexture(tep->getID());
if(mUVCoords.mV[VX] >= 0.f && mUVCoords.mV[VY] >= 0.f && imagep.notNull())
{
- mXYCoords.mX = llround(mUVCoords.mV[VX] * (F32)imagep->getWidth());
- mXYCoords.mY = llround((1.f - mUVCoords.mV[VY]) * (F32)imagep->getHeight());
+ mXYCoords.mX = ll_round(mUVCoords.mV[VX] * (F32)imagep->getWidth());
+ mXYCoords.mY = ll_round((1.f - mUVCoords.mV[VY]) * (F32)imagep->getHeight());
}
}
}
@@ -5436,7 +5436,7 @@ void LLPickInfo::getSurfaceInfo()
if (objectp)
{
- if (gViewerWindow->cursorIntersect(llround((F32)mMousePt.mX), llround((F32)mMousePt.mY), 1024.f,
+ if (gViewerWindow->cursorIntersect(ll_round((F32)mMousePt.mX), ll_round((F32)mMousePt.mY), 1024.f,
objectp, -1, mPickTransparent,
&mObjectFace,
&intersection,
@@ -5478,52 +5478,6 @@ void LLPickInfo::getSurfaceInfo()
}
}
-
-/* code to get UV via a special UV render - removed in lieu of raycast method
-LLVector2 LLPickInfo::pickUV()
-{
- LLVector2 result(-1.f, -1.f);
-
- LLViewerObject* objectp = getObject();
- if (!objectp)
- {
- return result;
- }
-
- if (mObjectFace > -1 &&
- objectp->mDrawable.notNull() && objectp->getPCode() == LL_PCODE_VOLUME &&
- mObjectFace < objectp->mDrawable->getNumFaces())
- {
- S32 scaled_x = llround((F32)mPickPt.mX * gViewerWindow->getDisplayScale().mV[VX]);
- S32 scaled_y = llround((F32)mPickPt.mY * gViewerWindow->getDisplayScale().mV[VY]);
- const S32 UV_PICK_WIDTH = 5;
- const S32 UV_PICK_HALF_WIDTH = (UV_PICK_WIDTH - 1) / 2;
- U8 uv_pick_buffer[UV_PICK_WIDTH * UV_PICK_WIDTH * 4];
- LLFace* facep = objectp->mDrawable->getFace(mObjectFace);
- if (facep)
- {
- LLGLState scissor_state(GL_SCISSOR_TEST);
- scissor_state.enable();
- LLViewerCamera::getInstance()->setPerspective(FOR_SELECTION, scaled_x - UV_PICK_HALF_WIDTH, scaled_y - UV_PICK_HALF_WIDTH, UV_PICK_WIDTH, UV_PICK_WIDTH, FALSE);
- //glViewport(scaled_x - UV_PICK_HALF_WIDTH, scaled_y - UV_PICK_HALF_WIDTH, UV_PICK_WIDTH, UV_PICK_WIDTH);
- glScissor(scaled_x - UV_PICK_HALF_WIDTH, scaled_y - UV_PICK_HALF_WIDTH, UV_PICK_WIDTH, UV_PICK_WIDTH);
-
- glClear(GL_DEPTH_BUFFER_BIT);
-
- facep->renderSelectedUV();
-
- glReadPixels(scaled_x - UV_PICK_HALF_WIDTH, scaled_y - UV_PICK_HALF_WIDTH, UV_PICK_WIDTH, UV_PICK_WIDTH, GL_RGBA, GL_UNSIGNED_BYTE, uv_pick_buffer);
- U8* center_pixel = &uv_pick_buffer[4 * ((UV_PICK_WIDTH * UV_PICK_HALF_WIDTH) + UV_PICK_HALF_WIDTH + 1)];
-
- result.mV[VX] = (F32)((center_pixel[VGREEN] & 0xf) + (16.f * center_pixel[VRED])) / 4095.f;
- result.mV[VY] = (F32)((center_pixel[VGREEN] >> 4) + (16.f * center_pixel[VBLUE])) / 4095.f;
- }
- }
-
- return result;
-} */
-
-
//static
bool LLPickInfo::isFlora(LLViewerObject* object)
{
diff --git a/indra/newview/llvlcomposition.cpp b/indra/newview/llvlcomposition.cpp
index 4e9400872a..c4430f4308 100755
--- a/indra/newview/llvlcomposition.cpp
+++ b/indra/newview/llvlcomposition.cpp
@@ -123,10 +123,10 @@ BOOL LLVLComposition::generateHeights(const F32 x, const F32 y,
S32 x_begin, y_begin, x_end, y_end;
- x_begin = llround( x * mScaleInv );
- y_begin = llround( y * mScaleInv );
- x_end = llround( (x + width) * mScaleInv );
- y_end = llround( (y + width) * mScaleInv );
+ x_begin = ll_round( x * mScaleInv );
+ y_begin = ll_round( y * mScaleInv );
+ x_end = ll_round( (x + width) * mScaleInv );
+ y_end = ll_round( (y + width) * mScaleInv );
if (x_end > mWidth)
{
@@ -318,8 +318,8 @@ BOOL LLVLComposition::generateTexture(const F32 x, const F32 y,
S32 x_begin, y_begin, x_end, y_end;
x_begin = (S32)(x * mScaleInv);
y_begin = (S32)(y * mScaleInv);
- x_end = llround( (x + width) * mScaleInv );
- y_end = llround( (y + width) * mScaleInv );
+ x_end = ll_round( (x + width) * mScaleInv );
+ y_end = ll_round( (y + width) * mScaleInv );
if (x_end > mWidth)
{
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index cfe83cb0b6..1069a55744 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -134,10 +134,6 @@ const LLUUID ANIM_AGENT_PHYSICS_MOTION = LLUUID("7360e029-3cb8-ebc4-863e-212df44
//-----------------------------------------------------------------------------
// Constants
//-----------------------------------------------------------------------------
-
-const S32 MIN_PIXEL_AREA_FOR_COMPOSITE = 1024;
-const F32 SHADOW_OFFSET_AMT = 0.03f;
-
const F32 DELTA_TIME_MIN = 0.01f; // we clamp measured deltaTime to this
const F32 DELTA_TIME_MAX = 0.2f; // range to insure stability of computations.
@@ -145,22 +141,15 @@ const F32 PELVIS_LAG_FLYING = 0.22f;// pelvis follow half life while flying
const F32 PELVIS_LAG_WALKING = 0.4f; // ...while walking
const F32 PELVIS_LAG_MOUSELOOK = 0.15f;
const F32 MOUSELOOK_PELVIS_FOLLOW_FACTOR = 0.5f;
-const F32 PELVIS_LAG_WHEN_FOLLOW_CAM_IS_ON = 0.0001f; // not zero! - something gets divided by this!
const F32 TORSO_NOISE_AMOUNT = 1.0f; // Amount of deviation from up-axis, in degrees
const F32 TORSO_NOISE_SPEED = 0.2f; // Time scale factor on torso noise.
const F32 BREATHE_ROT_MOTION_STRENGTH = 0.05f;
-const F32 BREATHE_SCALE_MOTION_STRENGTH = 0.005f;
-
-const F32 MIN_SHADOW_HEIGHT = 0.f;
-const F32 MAX_SHADOW_HEIGHT = 0.3f;
const S32 MIN_REQUIRED_PIXEL_AREA_BODY_NOISE = 10000;
const S32 MIN_REQUIRED_PIXEL_AREA_BREATHE = 10000;
const S32 MIN_REQUIRED_PIXEL_AREA_PELVIS_FIX = 40;
-const S32 TEX_IMAGE_SIZE_SELF = 512;
-const S32 TEX_IMAGE_AREA_SELF = TEX_IMAGE_SIZE_SELF * TEX_IMAGE_SIZE_SELF;
const S32 TEX_IMAGE_SIZE_OTHER = 512 / 4; // The size of local textures for other (!isSelf()) avatars
const F32 HEAD_MOVEMENT_AVG_TIME = 0.9f;
@@ -464,7 +453,10 @@ public:
mCharacter = character;
BOOL success = true;
- if ( !mChestState->setJoint( character->getJoint( "mChest" ) ) ) { success = false; }
+ if ( !mChestState->setJoint( character->getJoint( "mChest" ) ) )
+ {
+ success = false;
+ }
if ( success )
{
@@ -708,7 +700,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
mVisualComplexity(0),
mVisualComplexityStale(TRUE),
mLoadedCallbacksPaused(FALSE),
- mHasPelvisOffset( FALSE ),
mRenderUnloadedAvatar(LLCachedControl<bool>(gSavedSettings, "RenderUnloadedAvatar", false)),
mLastRezzedStatus(-1),
mIsEditingAppearance(FALSE),
@@ -770,10 +761,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
mRuthTimer.reset();
mRuthDebugTimer.reset();
mDebugExistenceTimer.reset();
- mPelvisOffset = LLVector3(0.0f,0.0f,0.0f);
- mLastPelvisToFoot = 0.0f;
- mPelvisFixup = 0.0f;
- mLastPelvisFixup = 0.0f;
if(LLSceneMonitor::getInstance()->isEnabled())
{
@@ -818,14 +805,14 @@ 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();
@@ -1258,17 +1245,18 @@ const LLVector3 LLVOAvatar::getRenderPosition() const
}
else if (isRoot())
{
- if ( !mHasPelvisOffset )
- {
- return mDrawable->getPositionAgent();
- }
- else
+ F32 fixup;
+ if ( hasPelvisFixup( fixup) )
{
//Apply a pelvis fixup (as defined by the avs skin)
LLVector3 pos = mDrawable->getPositionAgent();
- pos[VZ] += mPelvisFixup;
+ pos[VZ] += fixup;
return pos;
}
+ else
+ {
+ return mDrawable->getPositionAgent();
+ }
}
else
{
@@ -1353,38 +1341,36 @@ void LLVOAvatar::getSpatialExtents(LLVector4a& newMin, LLVector4a& newMax)
{
LLViewerJointAttachment* attachment = iter->second;
- if (!attachment->getValid())
- {
- continue ;
- }
-
- for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
- attachment_iter != attachment->mAttachedObjects.end();
- ++attachment_iter)
+ if (attachment->getValid())
{
- const LLViewerObject* attached_object = (*attachment_iter);
- if (attached_object && !attached_object->isHUDAttachment())
+ for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin();
+ attachment_iter != attachment->mAttachedObjects.end();
+ ++attachment_iter)
{
- LLDrawable* drawable = attached_object->mDrawable;
- if (drawable && !drawable->isState(LLDrawable::RIGGED))
+ const LLViewerObject* attached_object = (*attachment_iter);
+ if (attached_object && !attached_object->isHUDAttachment())
{
- LLSpatialBridge* bridge = drawable->getSpatialBridge();
- if (bridge)
+ LLDrawable* drawable = attached_object->mDrawable;
+ if (drawable && !drawable->isState(LLDrawable::RIGGED))
{
- const LLVector4a* ext = bridge->getSpatialExtents();
- LLVector4a distance;
- distance.setSub(ext[1], ext[0]);
- LLVector4a max_span(max_attachment_span);
+ LLSpatialBridge* bridge = drawable->getSpatialBridge();
+ if (bridge)
+ {
+ const LLVector4a* ext = bridge->getSpatialExtents();
+ LLVector4a distance;
+ distance.setSub(ext[1], ext[0]);
+ LLVector4a max_span(max_attachment_span);
- S32 lt = distance.lessThan(max_span).getGatheredBits() & 0x7;
+ S32 lt = distance.lessThan(max_span).getGatheredBits() & 0x7;
- // Only add the prim to spatial extents calculations if it isn't a megaprim.
- // max_attachment_span calculated at the start of the function
- // (currently 5 times our max prim size)
- if (lt == 0x7)
- {
- update_min_max(newMin,newMax,ext[0]);
- update_min_max(newMin,newMax,ext[1]);
+ // Only add the prim to spatial extents calculations if it isn't a megaprim.
+ // max_attachment_span calculated at the start of the function
+ // (currently 5 times our max prim size)
+ if (lt == 0x7)
+ {
+ update_min_max(newMin,newMax,ext[0]);
+ update_min_max(newMin,newMax,ext[1]);
+ }
}
}
}
@@ -1961,7 +1947,7 @@ U32 LLVOAvatar::processUpdateMessage(LLMessageSystem *mesgsys,
if (has_name && getNVPair("FirstName"))
{
mDebugExistenceTimer.reset();
- debugAvatarRezTime("AvatarRezArrivedNotification","avatar arrived");
+ debugAvatarRezTime("AvatarRezArrivedNotification","avatar arrived");
}
if(retval & LLViewerObject::INVALID_UPDATE)
@@ -3179,6 +3165,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
{
debug_line += llformat(" - cof rcv:%d", last_received_cof_version);
}
+ debug_line += llformat(" bsz-z: %f avofs-z: %f", mBodySize[2], mAvatarOffset[2]);
addDebugText(debug_line);
}
if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked"))
@@ -3689,21 +3676,6 @@ void LLVOAvatar::updateHeadOffset()
}
}
//------------------------------------------------------------------------
-// setPelvisOffset
-//------------------------------------------------------------------------
-void LLVOAvatar::setPelvisOffset( bool hasOffset, const LLVector3& offsetAmount, F32 pelvisFixup )
-{
- mHasPelvisOffset = hasOffset;
- if ( mHasPelvisOffset )
- {
- //Store off last pelvis to foot value
- mLastPelvisToFoot = mPelvisToFoot;
- mPelvisOffset = offsetAmount;
- mLastPelvisFixup = mPelvisFixup;
- mPelvisFixup = pelvisFixup;
- }
-}
-//------------------------------------------------------------------------
// postPelvisSetRecalc
//------------------------------------------------------------------------
void LLVOAvatar::postPelvisSetRecalc( void )
@@ -3713,15 +3685,6 @@ void LLVOAvatar::postPelvisSetRecalc( void )
dirtyMesh(2);
}
//------------------------------------------------------------------------
-// setPelvisOffset
-//------------------------------------------------------------------------
-void LLVOAvatar::setPelvisOffset( F32 pelvisFixupAmount )
-{
- mHasPelvisOffset = true;
- mLastPelvisFixup = mPelvisFixup;
- mPelvisFixup = pelvisFixupAmount;
-}
-//------------------------------------------------------------------------
// updateVisibility()
//------------------------------------------------------------------------
void LLVOAvatar::updateVisibility()
@@ -3941,13 +3904,13 @@ U32 LLVOAvatar::renderSkinned()
if (face)
{
LLVertexBuffer* vb = face->getVertexBuffer();
- if (vb)
- {
- vb->flush();
+ if (vb)
+ {
+ vb->flush();
+ }
}
}
}
- }
else
{
mNeedsSkin = FALSE;
@@ -4122,12 +4085,12 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass)
}
// Can't test for baked hair being defined, since that won't always be the case (not all viewers send baked hair)
// TODO: 1.25 will be able to switch this logic back to calling isTextureVisible();
- if ( getImage(TEX_HAIR_BAKED, 0) &&
- getImage(TEX_HAIR_BAKED, 0)->getID() != IMG_INVISIBLE || LLDrawPoolAlpha::sShowDebugAlpha)
+ if ( ( getImage(TEX_HAIR_BAKED, 0) &&
+ getImage(TEX_HAIR_BAKED, 0)->getID() != IMG_INVISIBLE ) || LLDrawPoolAlpha::sShowDebugAlpha)
{
LLViewerJoint* hair_mesh = getViewerJoint(MESH_ID_HAIR);
if (hair_mesh)
- {
+ {
num_indices += hair_mesh->render(mAdjustedPixelArea, first_pass, mIsDummy);
}
first_pass = FALSE;
@@ -4850,6 +4813,12 @@ BOOL LLVOAvatar::processSingleAnimationStateChange( const LLUUID& anim_id, BOOL
{
sitDown(FALSE);
}
+ if ((anim_id == ANIM_AGENT_DO_NOT_DISTURB) && gAgent.isDoNotDisturb())
+ {
+ // re-assert DND tag animation
+ gAgent.sendAnimationRequest(ANIM_AGENT_DO_NOT_DISTURB, ANIM_REQUEST_START);
+ return result;
+ }
stopMotion(anim_id);
result = TRUE;
}
@@ -5023,10 +4992,162 @@ LLJoint *LLVOAvatar::getJoint( const std::string &name )
return jointp;
}
+
//-----------------------------------------------------------------------------
-// resetJointPositionsToDefault
+// getRiggedMeshID
+//
+// If viewer object is a rigged mesh, set the mesh id and return true.
+// Otherwise, null out the id and return false.
//-----------------------------------------------------------------------------
-void LLVOAvatar::resetJointPositionsToDefault( void )
+// static
+bool LLVOAvatar::getRiggedMeshID(LLViewerObject* pVO, LLUUID& mesh_id)
+{
+ mesh_id.setNull();
+
+ //If a VO has a skin that we'll reset the joint positions to their default
+ if ( pVO && pVO->mDrawable )
+ {
+ LLVOVolume* pVObj = pVO->mDrawable->getVOVolume();
+ if ( pVObj )
+ {
+ const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( pVObj->getVolume()->getParams().getSculptID(), pVObj );
+ if (pSkinData
+ && pSkinData->mJointNames.size() > JOINT_COUNT_REQUIRED_FOR_FULLRIG // full rig
+ && pSkinData->mAlternateBindMatrix.size() > 0 )
+ {
+ mesh_id = pSkinData->mMeshID;
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+void LLVOAvatar::clearAttachmentPosOverrides()
+{
+ //Subsequent joints are relative to pelvis
+ avatar_joint_list_t::iterator iter = mSkeleton.begin();
+ avatar_joint_list_t::iterator end = mSkeleton.end();
+
+ for (; iter != end; ++iter)
+ {
+ LLJoint* pJoint = (*iter);
+ pJoint->clearAttachmentPosOverrides();
+ }
+}
+
+//-----------------------------------------------------------------------------
+// addAttachmentPosOverridesForObject
+//-----------------------------------------------------------------------------
+void LLVOAvatar::addAttachmentPosOverridesForObject(LLViewerObject *vo)
+{
+ LLVOAvatar *av = vo->getAvatarAncestor();
+ if (!av || (av != this))
+ {
+ LL_WARNS("Avatar") << "called with invalid avatar" << LL_ENDL;
+ }
+
+ // Process all children
+ LLViewerObject::const_child_list_t& children = vo->getChildren();
+ for (LLViewerObject::const_child_list_t::const_iterator it = children.begin();
+ it != children.end(); ++it)
+ {
+ LLViewerObject *childp = *it;
+ addAttachmentPosOverridesForObject(childp);
+ }
+
+ LLVOVolume *vobj = dynamic_cast<LLVOVolume*>(vo);
+ bool pelvisGotSet = false;
+
+ if (!vobj)
+ {
+ return;
+ }
+ if (vobj->isMesh() &&
+ ((vobj->getVolume() && !vobj->getVolume()->isMeshAssetLoaded()) || !gMeshRepo.meshRezEnabled()))
+ {
+ return;
+ }
+ LLUUID currentId = vobj->getVolume()->getParams().getSculptID();
+ const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( currentId, vobj );
+
+ if ( vobj && vobj->isAttachment() && vobj->isMesh() && pSkinData )
+ {
+ const int bindCnt = pSkinData->mAlternateBindMatrix.size();
+ if ( bindCnt > 0 )
+ {
+ const int jointCnt = pSkinData->mJointNames.size();
+ const F32 pelvisZOffset = pSkinData->mPelvisOffset;
+ const LLUUID& mesh_id = pSkinData->mMeshID;
+ 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();
+ LLJoint* pJoint = getJoint( lookingForJoint );
+ if ( pJoint && pJoint->getId() != currentId )
+ {
+ pJoint->setId( currentId );
+ const LLVector3& jointPos = pSkinData->mAlternateBindMatrix[i].getTranslation();
+ //Set the joint position
+ pJoint->addAttachmentPosOverride( jointPos, mesh_id, avString() );
+
+ //If joint is a pelvis then handle old/new pelvis to foot values
+ if ( lookingForJoint == "mPelvis" )
+ {
+ pelvisGotSet = true;
+ }
+ }
+ }
+ if (pelvisZOffset != 0.0F)
+ {
+ addPelvisFixup( pelvisZOffset, mesh_id );
+ pelvisGotSet = true;
+ }
+ }
+ }
+ }
+
+ //Rebuild body data if we altered joints/pelvis
+ if ( pelvisGotSet )
+ {
+ postPelvisSetRecalc();
+ }
+}
+
+//-----------------------------------------------------------------------------
+// resetJointPositionsOnDetach
+//-----------------------------------------------------------------------------
+void LLVOAvatar::resetJointPositionsOnDetach(LLViewerObject *vo)
+{
+ LLVOAvatar *av = vo->getAvatarAncestor();
+ if (!av || (av != this))
+ {
+ LL_WARNS("Avatar") << "called with invalid avatar" << LL_ENDL;
+ }
+
+ // Process all children
+ LLViewerObject::const_child_list_t& children = vo->getChildren();
+ for (LLViewerObject::const_child_list_t::const_iterator it = children.begin();
+ it != children.end(); ++it)
+ {
+ LLViewerObject *childp = *it;
+ resetJointPositionsOnDetach(childp);
+ }
+
+ // Process self.
+ LLUUID mesh_id;
+ if (getRiggedMeshID(vo,mesh_id))
+ {
+ resetJointPositionsOnDetach(mesh_id);
+ }
+}
+
+//-----------------------------------------------------------------------------
+// resetJointPositionsOnDetach
+//-----------------------------------------------------------------------------
+void LLVOAvatar::resetJointPositionsOnDetach(const LLUUID& mesh_id)
{
//Subsequent joints are relative to pelvis
avatar_joint_list_t::iterator iter = mSkeleton.begin();
@@ -5038,23 +5159,18 @@ void LLVOAvatar::resetJointPositionsToDefault( void )
{
LLJoint* pJoint = (*iter);
//Reset joints except for pelvis
- if ( pJoint && pJoint != pJointPelvis && pJoint->doesJointNeedToBeReset() )
+ if ( pJoint )
{
pJoint->setId( LLUUID::null );
- pJoint->restoreOldXform();
+ pJoint->removeAttachmentPosOverride(mesh_id, avString());
}
- else
- if ( pJoint && pJoint == pJointPelvis && pJoint->doesJointNeedToBeReset() )
+ if ( pJoint && pJoint == pJointPelvis)
{
- pJoint->setId( LLUUID::null );
+ removePelvisFixup( mesh_id );
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();
}
//-----------------------------------------------------------------------------
@@ -5179,8 +5295,8 @@ BOOL LLVOAvatar::loadSkeletonNode ()
{
if (!LLAvatarAppearance::loadSkeletonNode())
{
- return FALSE;
- }
+ return FALSE;
+ }
// ATTACHMENTS
{
@@ -5591,7 +5707,7 @@ const LLViewerJointAttachment *LLVOAvatar::attachObject(LLViewerObject *viewer_o
}
//-----------------------------------------------------------------------------
-// attachObject()
+// getNumAttachments()
//-----------------------------------------------------------------------------
U32 LLVOAvatar::getNumAttachments() const
{
@@ -5701,30 +5817,18 @@ void LLVOAvatar::rebuildRiggedAttachments( void )
//-----------------------------------------------------------------------------
void LLVOAvatar::cleanupAttachedMesh( LLViewerObject* pVO )
{
- //If a VO has a skin that we'll reset the joint positions to their default
- if ( pVO && pVO->mDrawable )
+ LLUUID mesh_id;
+ if (getRiggedMeshID(pVO, mesh_id))
{
- LLVOVolume* pVObj = pVO->mDrawable->getVOVolume();
- if ( pVObj )
+ resetJointPositionsOnDetach(mesh_id);
+ if ( gAgentCamera.cameraCustomizeAvatar() )
{
- const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( pVObj->getVolume()->getParams().getSculptID(), pVObj );
- if (pSkinData
- && 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() )
- {
- gAgent.unpauseAnimation();
- //Still want to refocus on head bone
- gAgentCamera.changeCameraToCustomizeAvatar();
- }
- }
- }
- }
+ gAgent.unpauseAnimation();
+ //Still want to refocus on head bone
+ gAgentCamera.changeCameraToCustomizeAvatar();
}
+ }
+}
//-----------------------------------------------------------------------------
// detachObject()
@@ -5931,27 +6035,24 @@ BOOL LLVOAvatar::isWearingWearableType(LLWearableType::EType type) const
break; // Do nothing
}
- /* switch(type)
- case LLWearableType::WT_SHIRT:
- indicator_te = TEX_UPPER_SHIRT; */
for (LLAvatarAppearanceDictionary::Textures::const_iterator tex_iter = LLAvatarAppearanceDictionary::getInstance()->getTextures().begin();
tex_iter != LLAvatarAppearanceDictionary::getInstance()->getTextures().end();
++tex_iter)
{
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;
}
@@ -6021,7 +6122,7 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color)
}
else if (global_color == mTexEyeColor)
{
-// LL_INFOS() << "invalidateComposite cause: onGlobalColorChanged( eyecolor )" << LL_ENDL;
+ // LL_INFOS() << "invalidateComposite cause: onGlobalColorChanged( eyecolor )" << LL_ENDL;
invalidateComposite( mBakedTextureDatas[BAKED_EYES].mTexLayerSet);
}
updateMeshTextures();
@@ -6082,9 +6183,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)
{
@@ -6093,16 +6194,15 @@ 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;
}
}
@@ -6164,7 +6264,7 @@ void LLVOAvatar::stopPhase(const std::string& phase_name, bool err_check)
void LLVOAvatar::logPendingPhases()
{
if (!isAgentAvatarValid())
- {
+ {
return;
}
@@ -6180,14 +6280,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)
{
@@ -6198,14 +6298,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;
@@ -6214,10 +6314,10 @@ 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"] = true;
@@ -6278,8 +6378,8 @@ BOOL LLVOAvatar::processFullyLoadedChange(bool loading)
mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > PAUSE);
- if (!mPreviousFullyLoaded && !loading && mFullyLoaded)
- {
+ if (!mPreviousFullyLoaded && !loading && mFullyLoaded)
+ {
debugAvatarRezTime("AvatarRezNotification","fully loaded");
}
@@ -6325,9 +6425,7 @@ void LLVOAvatar::debugColorizeSubMeshes(U32 i, const LLColor4& color)
LLAvatarJointMesh* mesh = (*iter);
if (mesh)
{
- {
- mesh->setColor(color);
- }
+ mesh->setColor(color);
}
}
}
@@ -6427,7 +6525,7 @@ void LLVOAvatar::updateMeshTextures()
LLViewerTexLayerSet* layerset = getTexLayerSet(i);
if (use_lkg_baked_layer[i] && !isUsingLocalAppearance() )
- {
+ {
LLViewerFetchedTexture* baked_img = LLViewerTextureManager::getFetchedTexture(mBakedTextureDatas[i].mLastTextureID);
mBakedTextureDatas[i].mIsUsed = TRUE;
@@ -6436,12 +6534,12 @@ void LLVOAvatar::updateMeshTextures()
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])
@@ -6470,9 +6568,9 @@ 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();
+ // this could add paused texture callbacks
+ mLoadedCallbacksPaused |= paused;
+ checkTextureLoading();
}
}
else if (layerset && isUsingLocalAppearance())
@@ -6491,7 +6589,7 @@ void LLVOAvatar::updateMeshTextures()
if (mesh)
{
mesh->setLayerSet( layerset );
- }
+ }
}
}
else
@@ -6513,7 +6611,7 @@ void LLVOAvatar::updateMeshTextures()
{
LLAvatarJointMesh* mesh = (*iter);
if (mesh)
- {
+ {
mesh->setColor( color );
mesh->setTexture( hair_img );
}
@@ -6609,13 +6707,13 @@ void LLVOAvatar::applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_com
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);
-}
+ }
}
}
@@ -6914,9 +7012,9 @@ 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 << LL_ENDL;
@@ -6951,7 +7049,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)
{
@@ -7034,7 +7132,7 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe
if (it != contents.mParams.end())
{
S32 index = it - contents.mParams.begin();
- contents.mParamAppearanceVersion = llround(contents.mParamWeights[index]);
+ contents.mParamAppearanceVersion = ll_round(contents.mParamWeights[index]);
LL_DEBUGS("Avatar") << "appversion req by appearance_version param: " << contents.mParamAppearanceVersion << LL_ENDL;
}
}
@@ -7480,12 +7578,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 );
- }
+ }
}
}
@@ -7509,14 +7607,13 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id )
{
LLAvatarJointMesh* mesh = (*iter);
if (mesh)
- {
+ {
mesh->setColor( LLColor4::white );
}
}
}
}
}
-
dirtyMesh();
}
@@ -7528,7 +7625,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;
@@ -7561,44 +7658,61 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara
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
+ if (APR_SUCCESS == outfile.open(fullpath, LL_APR_WB ))
{
+ apr_file_t* file = outfile.getFileHandle();
LL_INFOS() << "xmlfile write handle obtained : " << fullpath << LL_ENDL;
- }
- apr_file_printf( file, "<?xml version=\"1.0\" encoding=\"US-ASCII\" standalone=\"yes\"?>\n" );
- apr_file_printf( file, "<linden_genepool version=\"1.0\">\n" );
- apr_file_printf( file, "\n\t<archetype name=\"???\">\n" );
+ apr_file_printf( file, "<?xml version=\"1.0\" encoding=\"US-ASCII\" standalone=\"yes\"?>\n" );
+ apr_file_printf( file, "<linden_genepool version=\"1.0\">\n" );
+ apr_file_printf( file, "\n\t<archetype name=\"???\">\n" );
- 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() );
-
- for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam())
+ if (group_by_wearables)
{
- LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param;
- if( (viewer_param->getWearableType() == type) &&
- (viewer_param->isTweakable() ) )
+ for (S32 type = LLWearableType::WT_SHAPE; type < LLWearableType::WT_COUNT; type++)
{
- dump_visual_param(file, viewer_param, viewer_param->getWeight());
+ 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() ) )
+ {
+ dump_visual_param(file, viewer_param, viewer_param->getWeight());
+ }
+ }
+
+ for (U8 te = 0; te < TEX_NUM_INDICES; te++)
+ {
+ if (LLAvatarAppearanceDictionary::getTEWearableType((ETextureIndex)te) == type)
+ {
+ // 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());
+ }
+ }
+ }
}
}
-
- for (U8 te = 0; te < TEX_NUM_INDICES; te++)
+ else
{
- if (LLAvatarAppearanceDictionary::getTEWearableType((ETextureIndex)te) == type)
+ // Just dump all params sequentially.
+ for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam())
+ {
+ LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param;
+ dump_visual_param(file, viewer_param, viewer_param->getWeight());
+ }
+
+ for (U8 te = 0; te < TEX_NUM_INDICES; te++)
{
// MULTIPLE_WEARABLES: extend to multiple wearables?
- LLViewerTexture* te_image = getImage((ETextureIndex)te, 0);
+ LLViewerTexture* te_image = getImage((ETextureIndex)te, 0);
if( te_image )
{
std::string uuid_str;
@@ -7607,40 +7721,48 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara
}
}
}
- }
- }
- else
- {
- // Just dump all params sequentially.
- for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam())
+
+ avatar_joint_list_t::iterator iter = mSkeleton.begin();
+ avatar_joint_list_t::iterator end = mSkeleton.end();
+ for (; iter != end; ++iter)
{
- LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param;
- dump_visual_param(file, viewer_param, viewer_param->getWeight());
+ LLJoint* pJoint = (*iter);
+ const LLVector3& pos = pJoint->getPosition();
+ const LLVector3& scale = pJoint->getScale();
+ apr_file_printf( file, "\t\t<joint name=\"%s\" position=\"%f %f %f\" scale=\"%f %f %f\"/>\n",
+ pJoint->getName().c_str(), pos[0], pos[1], pos[2], scale[0], scale[1], scale[2]);
}
- for (U8 te = 0; te < TEX_NUM_INDICES; te++)
+ for (iter = mSkeleton.begin(); iter != end; ++iter)
{
+ LLJoint* pJoint = (*iter);
+
+ LLVector3 pos;
+ LLUUID mesh_id;
+
+ if (pJoint->hasAttachmentPosOverride(pos,mesh_id))
{
- // 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());
- }
+ apr_file_printf( file, "\t\t<joint_offset name=\"%s\" position=\"%f %f %f\" mesh_id=\"%s\"/>\n",
+ pJoint->getName().c_str(), pos[0], pos[1], pos[2], mesh_id.asString().c_str());
}
}
+ F32 pelvis_fixup;
+ LLUUID mesh_id;
+ if (hasPelvisFixup(pelvis_fixup, mesh_id))
+ {
+ apr_file_printf( file, "\t\t<pelvis_fixup z=\"%f\" mesh_id=\"%s\"/>\n",
+ pelvis_fixup, mesh_id.asString().c_str());
+ }
- }
- apr_file_printf( file, "\t</archetype>\n" );
- apr_file_printf( file, "\n</linden_genepool>\n" );
+ apr_file_printf( file, "\t</archetype>\n" );
+ apr_file_printf( file, "\n</linden_genepool>\n" );
- bool ultra_verbose = false;
- if (isSelf() && ultra_verbose)
- {
- // show the cloned params inside the wearables as well.
- gAgentAvatarp->dumpWearableInfo(outfile);
+ bool ultra_verbose = false;
+ if (isSelf() && ultra_verbose)
+ {
+ // show the cloned params inside the wearables as well.
+ gAgentAvatarp->dumpWearableInfo(outfile);
+ }
}
// File will close when handle goes out of scope
}
@@ -7756,7 +7878,7 @@ void LLVOAvatar::startAppearanceAnimation()
// virtual
void LLVOAvatar::removeMissingBakedTextures()
- {
+{
}
//virtual
@@ -8080,7 +8202,6 @@ void LLVOAvatar::calculateUpdateRenderCost()
}
}
}
-
}
// Diagnostic output to identify all avatar-related textures.
@@ -8219,7 +8340,7 @@ BOOL LLVOAvatar::isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex te, U
{
return FALSE;
}
-
+
if( !getImage( te, index ) )
{
LL_WARNS() << "getImage( " << te << ", " << index << " ) returned 0" << LL_ENDL;
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index f0f8bbe21b..363f7b9f2a 100755
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -199,7 +199,10 @@ public:
virtual LLJoint* getJoint(const std::string &name);
- void resetJointPositionsToDefault( void );
+ void addAttachmentPosOverridesForObject(LLViewerObject *vo);
+ void resetJointPositionsOnDetach(const LLUUID& mesh_id);
+ void resetJointPositionsOnDetach(LLViewerObject *vo);
+ void clearAttachmentPosOverrides();
/*virtual*/ const LLUUID& getID() const;
/*virtual*/ void addDebugText(const std::string& text);
@@ -355,19 +358,11 @@ protected:
/*virtual*/ LLAvatarJointMesh* createAvatarJointMesh(); // Returns LLViewerJointMesh
public:
void updateHeadOffset();
- void setPelvisOffset( bool hasOffset, const LLVector3& translation, F32 offset ) ;
- bool hasPelvisOffset( void ) { return mHasPelvisOffset; }
void postPelvisSetRecalc( void );
- void setPelvisOffset( F32 pelvixFixupAmount );
/*virtual*/ BOOL loadSkeletonNode();
/*virtual*/ void buildCharacter();
- bool mHasPelvisOffset;
- LLVector3 mPelvisOffset;
- F32 mLastPelvisToFoot;
- F32 mPelvisFixup;
- F32 mLastPelvisFixup;
LLVector3 mCurRootToHeadOffset;
LLVector3 mTargetRootToHeadOffset;
@@ -719,6 +714,7 @@ public:
void clampAttachmentPositions();
virtual const LLViewerJointAttachment* attachObject(LLViewerObject *viewer_object);
virtual BOOL detachObject(LLViewerObject *viewer_object);
+ static bool getRiggedMeshID( LLViewerObject* pVO, LLUUID& mesh_id );
void cleanupAttachedMesh( LLViewerObject* pVO );
static LLVOAvatar* findAvatarFromAttachment(LLViewerObject* obj);
/*virtual*/ BOOL isWearingWearableType(LLWearableType::EType type ) const;
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index 42a7c2e576..170a8c41f4 100755
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -158,8 +158,7 @@ LLVOAvatarSelf::LLVOAvatarSelf(const LLUUID& id,
LLVOAvatar(id, pcode, regionp),
mScreenp(NULL),
mLastRegionHandle(0),
- mRegionCrossingCount(0),
- mInitialBakesLoaded(false)
+ mRegionCrossingCount(0)
{
mMotionController.mIsSelf = TRUE;
@@ -262,7 +261,7 @@ void LLVOAvatarSelf::markDead()
{
BOOL success = LLVOAvatar::loadAvatar();
- // set all parameters sotred directly in the avatar to have
+ // set all parameters stored directly in the avatar to have
// the isSelfParam to be TRUE - this is used to prevent
// them from being animated or trigger accidental rebakes
// when we copy params from the wearable to the base avatar.
@@ -718,13 +717,8 @@ void LLVOAvatarSelf::updateVisualParams()
LLVOAvatar::updateVisualParams();
}
-/*virtual*/
-void LLVOAvatarSelf::idleUpdateAppearanceAnimation()
+void LLVOAvatarSelf::writeWearablesToAvatar()
{
- // Animate all top-level wearable visual parameters
- gAgentWearables.animateAllWearableParams(calcMorphAmount());
-
- // apply wearable visual params to avatar
for (U32 type = 0; type < LLWearableType::WT_COUNT; type++)
{
LLWearable *wearable = gAgentWearables.getTopWearable((LLWearableType::EType)type);
@@ -734,6 +728,17 @@ void LLVOAvatarSelf::idleUpdateAppearanceAnimation()
}
}
+}
+
+/*virtual*/
+void LLVOAvatarSelf::idleUpdateAppearanceAnimation()
+{
+ // Animate all top-level wearable visual parameters
+ gAgentWearables.animateAllWearableParams(calcMorphAmount());
+
+ // Apply wearable visual params to avatar
+ writeWearablesToAvatar();
+
//allow avatar to process updates
LLVOAvatar::idleUpdateAppearanceAnimation();
@@ -1093,9 +1098,19 @@ LLViewerObject* LLVOAvatarSelf::getWornAttachment(const LLUUID& inv_item_id)
return NULL;
}
-const std::string LLVOAvatarSelf::getAttachedPointName(const LLUUID& inv_item_id) const
+bool LLVOAvatarSelf::getAttachedPointName(const LLUUID& inv_item_id, std::string& name) const
{
+ if (!gInventory.getItem(inv_item_id))
+ {
+ name = "ATTACHMENT_MISSING_ITEM";
+ return false;
+ }
const LLUUID& base_inv_item_id = gInventory.getLinkedItemID(inv_item_id);
+ if (!gInventory.getItem(base_inv_item_id))
+ {
+ name = "ATTACHMENT_MISSING_BASE_ITEM";
+ return false;
+ }
for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin();
iter != mAttachmentPoints.end();
++iter)
@@ -1103,11 +1118,13 @@ const std::string LLVOAvatarSelf::getAttachedPointName(const LLUUID& inv_item_id
const LLViewerJointAttachment* attachment = iter->second;
if (attachment->getAttachedObject(base_inv_item_id))
{
- return attachment->getName();
+ name = attachment->getName();
+ return true;
}
}
- return LLStringUtil::null;
+ name = "ATTACHMENT_NOT_ATTACHED";
+ return false;
}
//virtual
@@ -1142,8 +1159,6 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object)
const LLUUID attachment_id = viewer_object->getAttachmentItemID();
if ( LLVOAvatar::detachObject(viewer_object) )
{
- LLVOAvatar::cleanupAttachedMesh( viewer_object );
-
// the simulator should automatically handle permission revocation
stopMotionFromSource(attachment_id);
diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h
index e03de9fa0b..7f641b6242 100755
--- a/indra/newview/llvoavatarself.h
+++ b/indra/newview/llvoavatarself.h
@@ -86,12 +86,11 @@ public:
/*virtual*/ void requestStopMotion(LLMotion* motion);
/*virtual*/ LLJoint* getJoint(const std::string &name);
- void resetJointPositions( void );
-
/*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();
+ void writeWearablesToAvatar();
/*virtual*/ void idleUpdateAppearanceAnimation();
private:
@@ -106,7 +105,6 @@ private:
private:
LLUUID mInitialBakeIDs[6];
- bool mInitialBakesLoaded;
/********************************************************************************
@@ -293,7 +291,7 @@ public:
void addAttachmentRequest(const LLUUID& inv_item_id);
void removeAttachmentRequest(const LLUUID& inv_item_id);
LLViewerObject* getWornAttachment(const LLUUID& inv_item_id);
- const std::string getAttachedPointName(const LLUUID& inv_item_id) const;
+ bool getAttachedPointName(const LLUUID& inv_item_id, std::string& name) const;
/*virtual*/ const LLViewerJointAttachment *attachObject(LLViewerObject *viewer_object);
/*virtual*/ BOOL detachObject(LLViewerObject *viewer_object);
static BOOL detachAttachmentIntoInventory(const LLUUID& item_id);
diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp
index b79a48012a..8d8f33b601 100755
--- a/indra/newview/llvograss.cpp
+++ b/indra/newview/llvograss.cpp
@@ -51,7 +51,6 @@
const S32 GRASS_MAX_BLADES = 32;
const F32 GRASS_BLADE_BASE = 0.25f; // Width of grass at base
-const F32 GRASS_BLADE_TOP = 0.25f; // Width of grass at top
const F32 GRASS_BLADE_HEIGHT = 0.5f; // meters
const F32 GRASS_DISTRIBUTION_SD = 0.15f; // empirically defined
diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp
index 9a84cae403..426ca332e4 100755
--- a/indra/newview/llvoicechannel.cpp
+++ b/indra/newview/llvoicechannel.cpp
@@ -725,6 +725,8 @@ void LLVoiceChannelProximal::handleStatusChange(EStatusType status)
// do not notify user when leaving proximal channel
return;
case STATUS_VOICE_DISABLED:
+ LLVoiceClient::getInstance()->setUserPTTState(false);
+ gAgent.setVoiceConnected(false);
//skip showing "Voice not available at your current location" when agent voice is disabled (EXT-4749)
if(LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking())
{
diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp
index 0bf373f478..962cdf0268 100755
--- a/indra/newview/llvoiceclient.cpp
+++ b/indra/newview/llvoiceclient.cpp
@@ -161,6 +161,13 @@ void LLVoiceClient::userAuthorized(const std::string& user_id, const LLUUID &age
mVoiceModule->userAuthorized(user_id, agentID);
}
+void LLVoiceClient::setHidden(bool hidden)
+{
+ if (mVoiceModule)
+ {
+ mVoiceModule->setHidden(hidden);
+ }
+}
void LLVoiceClient::terminate()
{
diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h
index 1e20a814a0..fb387301be 100755
--- a/indra/newview/llvoiceclient.h
+++ b/indra/newview/llvoiceclient.h
@@ -105,6 +105,8 @@ public:
virtual void updateSettings()=0; // call after loading settings and whenever they change
virtual bool isVoiceWorking() const = 0; // connected to a voice server and voice channel
+
+ virtual void setHidden(bool hidden)=0; // Hides the user from voice.
virtual const LLVoiceVersionInfo& getVersion()=0;
@@ -342,6 +344,7 @@ public:
void setCaptureDevice(const std::string& name);
void setRenderDevice(const std::string& name);
+ void setHidden(bool hidden);
const LLVoiceDeviceList& getCaptureDevices();
const LLVoiceDeviceList& getRenderDevices();
diff --git a/indra/newview/llvoicevisualizer.cpp b/indra/newview/llvoicevisualizer.cpp
index 23a8a61b85..cb83cf8fdf 100755
--- a/indra/newview/llvoicevisualizer.cpp
+++ b/indra/newview/llvoicevisualizer.cpp
@@ -70,7 +70,6 @@ const F32 DEFAULT_MAXIMUM_GESTICULATION_AMPLITUDE = 1.0f;
//--------------------------------------------------------------------------------------
// other constants
//--------------------------------------------------------------------------------------
-const F32 ONE_HALF = 1.0f; // to clarify intent and reduce magic numbers in the code.
const LLVector3 WORLD_UPWARD_DIRECTION = LLVector3( 0.0f, 0.0f, 1.0f ); // Z is up in SL
//------------------------------------------------------------------
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index 54b4119331..a6a7a35b03 100755
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -70,6 +70,7 @@
#include "apr_base64.h"
#define USE_SESSION_GROUPS 0
+#define VX_NULL_POSITION -2147483648.0 /*The Silence*/
extern LLMenuBarGL* gMenuBarView;
extern void handle_voice_morphing_subscribe();
@@ -322,6 +323,7 @@ LLVivoxVoiceClient::LLVivoxVoiceClient() :
mCaptureBufferRecording(false),
mCaptureBufferRecorded(false),
mCaptureBufferPlaying(false),
+ mShutdownComplete(true),
mPlayRequestCount(0),
mAvatarNameCacheConnection()
@@ -376,7 +378,16 @@ void LLVivoxVoiceClient::terminate()
if(mConnected)
{
logout();
- connectorShutdown();
+ connectorShutdown();
+#ifdef LL_WINDOWS
+ int count=0;
+ while (!mShutdownComplete && 10 > count++)
+ {
+ stateMachine();
+ _sleep(1000);
+ }
+
+#endif
closeSocket(); // Need to do this now -- bad things happen if the destructor does it later.
cleanUp();
}
@@ -476,10 +487,9 @@ void LLVivoxVoiceClient::connectorCreate()
std::string savedLogLevel = gSavedSettings.getString("VivoxDebugLevel");
- if(savedLogLevel != "-0")
+ if(savedLogLevel != "0")
{
LL_DEBUGS("Voice") << "creating connector with logging enabled" << LL_ENDL;
- loglevel = "0";
}
stream
@@ -488,13 +498,14 @@ void LLVivoxVoiceClient::connectorCreate()
<< "<AccountManagementServer>" << mVoiceAccountServerURI << "</AccountManagementServer>"
<< "<Mode>Normal</Mode>"
<< "<Logging>"
- << "<Folder>" << logpath << "</Folder>"
- << "<FileNamePrefix>Connector</FileNamePrefix>"
- << "<FileNameSuffix>.log</FileNameSuffix>"
- << "<LogLevel>" << loglevel << "</LogLevel>"
+ << "<Folder>" << logpath << "</Folder>"
+ << "<FileNamePrefix>Connector</FileNamePrefix>"
+ << "<FileNameSuffix>.log</FileNameSuffix>"
+ << "<LogLevel>" << loglevel << "</LogLevel>"
<< "</Logging>"
- << "<Application>SecondLifeViewer.1</Application>"
- << "</Request>\n\n\n";
+ << "<Application></Application>" //Name can cause problems per vivox.
+ << "<MaxCalls>12</MaxCalls>"
+ << "</Request>\n\n\n";
writeString(stream.str());
}
@@ -512,6 +523,7 @@ void LLVivoxVoiceClient::connectorShutdown()
<< "</Request>"
<< "\n\n\n";
+ mShutdownComplete = false;
mConnectorHandle.clear();
writeString(stream.str());
@@ -788,15 +800,32 @@ void LLVivoxVoiceClient::stateMachine()
// vivox executable exists. Build the command line and launch the daemon.
LLProcess::Params params;
params.executable = exe_path;
- // SLIM SDK: these arguments are no longer necessary.
-// std::string args = " -p tcp -h -c";
+
std::string loglevel = gSavedSettings.getString("VivoxDebugLevel");
+ std::string shutdown_timeout = gSavedSettings.getString("VivoxShutdownTimeout");
if(loglevel.empty())
{
loglevel = "0"; // turn logging off completely
}
+
params.args.add("-ll");
params.args.add(loglevel);
+
+ std::string log_folder = gSavedSettings.getString("VivoxLogDirectory");
+
+ if (log_folder.empty())
+ {
+ log_folder = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "");
+ }
+
+ params.args.add("-lf");
+ params.args.add(log_folder);
+
+ if(!shutdown_timeout.empty())
+ {
+ params.args.add("-st");
+ params.args.add(shutdown_timeout);
+ }
params.cwd = gDirUtilp->getAppRODataDir();
sGatewayPtr = LLProcess::create(params);
@@ -1334,7 +1363,7 @@ void LLVivoxVoiceClient::stateMachine()
{
// Connect to a session by URI
sessionCreateSendMessage(mAudioSession, true, false);
- }
+ }
notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_JOINING);
setState(stateJoiningSession);
@@ -1510,7 +1539,7 @@ void LLVivoxVoiceClient::stateMachine()
// Always reset the terminate request flag when we get here.
mSessionTerminateRequested = false;
- if((mVoiceEnabled || !mIsInitialized) && !mRelogRequested)
+ if((mVoiceEnabled || !mIsInitialized) && !mRelogRequested && !LLApp::isExiting())
{
// Just leaving a channel, go back to stateNoChannel (the "logged in but have no channel" state).
setState(stateNoChannel);
@@ -1553,6 +1582,7 @@ void LLVivoxVoiceClient::stateMachine()
//MARK: stateConnectorStopping
case stateConnectorStopping: // waiting for connector stop
// The handler for the Connector.InitiateShutdown response will transition from here to stateConnectorStopped.
+ mShutdownComplete = true;
break;
//MARK: stateConnectorStopped
@@ -2318,6 +2348,14 @@ static void oldSDKTransform (LLVector3 &left, LLVector3 &up, LLVector3 &at, LLVe
#endif
}
+void LLVivoxVoiceClient::setHidden(bool hidden)
+{
+ mHidden = hidden;
+
+ sendPositionalUpdate();
+ return;
+}
+
void LLVivoxVoiceClient::sendPositionalUpdate(void)
{
std::ostringstream stream;
@@ -2339,14 +2377,23 @@ void LLVivoxVoiceClient::sendPositionalUpdate(void)
l = mAvatarRot.getLeftRow();
u = mAvatarRot.getUpRow();
a = mAvatarRot.getFwdRow();
- pos = mAvatarPosition;
+
+ pos = mAvatarPosition;
vel = mAvatarVelocity;
// SLIM SDK: the old SDK was doing a transform on the passed coordinates that the new one doesn't do anymore.
// The old transform is replicated by this function.
oldSDKTransform(l, u, a, pos, vel);
+
+ if (mHidden)
+ {
+ for (int i=0;i<3;++i)
+ {
+ pos.mdV[i] = VX_NULL_POSITION;
+ }
+ }
- stream
+ stream
<< "<Position>"
<< "<X>" << pos.mdV[VX] << "</X>"
<< "<Y>" << pos.mdV[VY] << "</Y>"
@@ -2406,14 +2453,23 @@ void LLVivoxVoiceClient::sendPositionalUpdate(void)
l = earRot.getLeftRow();
u = earRot.getUpRow();
a = earRot.getFwdRow();
- pos = earPosition;
+
+ pos = earPosition;
vel = earVelocity;
// LL_DEBUGS("Voice") << "Sending listener position " << earPosition << LL_ENDL;
oldSDKTransform(l, u, a, pos, vel);
- stream
+ if (mHidden)
+ {
+ for (int i=0;i<3;++i)
+ {
+ pos.mdV[i] = VX_NULL_POSITION;
+ }
+ }
+
+ stream
<< "<Position>"
<< "<X>" << pos.mdV[VX] << "</X>"
<< "<Y>" << pos.mdV[VY] << "</Y>"
@@ -2463,7 +2519,7 @@ void LLVivoxVoiceClient::sendPositionalUpdate(void)
if(!p->mIsSelf)
{
// scale from the range 0.0-1.0 to vivox volume in the range 0-100
- S32 volume = llround(p->mVolume / VOLUME_SCALE_VIVOX);
+ S32 volume = ll_round(p->mVolume / VOLUME_SCALE_VIVOX);
bool mute = p->mOnMuteList;
if(mute)
@@ -3169,7 +3225,7 @@ void LLVivoxVoiceClient::mediaStreamUpdatedEvent(
session->mErrorStatusCode = statusCode;
break;
}
-
+
switch(state)
{
case streamStateIdle:
@@ -5433,7 +5489,8 @@ void LLVivoxVoiceClient::notifyStatusObservers(LLVoiceClientStatusObserver::ESta
// skipped to avoid speak button blinking
if ( status != LLVoiceClientStatusObserver::STATUS_JOINING
- && status != LLVoiceClientStatusObserver::STATUS_LEFT_CHANNEL)
+ && status != LLVoiceClientStatusObserver::STATUS_LEFT_CHANNEL
+ && status != LLVoiceClientStatusObserver::STATUS_VOICE_DISABLED)
{
bool voice_status = LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking();
diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h
index 5e876fa2ef..a4ec9f2a69 100755
--- a/indra/newview/llvoicevivox.h
+++ b/indra/newview/llvoicevivox.h
@@ -723,6 +723,7 @@ private:
bool mRenderDeviceDirty;
bool mIsInitialized;
+ bool mShutdownComplete;
bool checkParcelChanged(bool update = false);
@@ -747,6 +748,7 @@ private:
std::string getAudioSessionURI();
std::string getAudioSessionHandle();
+ void setHidden(bool hidden); //virtual
void sendPositionalUpdate(void);
void buildSetCaptureDevice(std::ostringstream &stream);
@@ -775,6 +777,7 @@ private:
bool mMuteMic;
bool mMuteMicDirty;
+ bool mHidden; //Set to true during teleport to hide the agent's position.
// Set to true when the friends list is known to have changed.
bool mFriendsListDirty;
diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp
index c1593fa5fc..1ba0868544 100755
--- a/indra/newview/llvopartgroup.cpp
+++ b/indra/newview/llvopartgroup.cpp
@@ -44,8 +44,6 @@
#include "pipeline.h"
#include "llspatialpartition.h"
-const F32 MAX_PART_LIFETIME = 120.f;
-
extern U64MicrosecondsImplicit gFrameTime;
LLPointer<LLVertexBuffer> LLVOPartGroup::sVB = NULL;
@@ -683,7 +681,7 @@ void LLVOPartGroup::getGeometry(S32 idx,
}
else
{
- pglow = LLColor4U(0, 0, 0, (U8) llround(255.f*part.mStartGlow));
+ pglow = LLColor4U(0, 0, 0, (U8) ll_round(255.f*part.mStartGlow));
pcolor = part.mStartColor;
}
}
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp
index 07c2f0d44d..4dab213fa0 100755
--- a/indra/newview/llvosky.cpp
+++ b/indra/newview/llvosky.cpp
@@ -62,8 +62,6 @@ static const S32 NUM_TILES = NUM_TILES_X * NUM_TILES_Y;
static const F32 SUN_DISK_RADIUS = 0.5f;
static const F32 MOON_DISK_RADIUS = SUN_DISK_RADIUS * 0.9f;
static const F32 SUN_INTENSITY = 1e5;
-static const F32 SUN_DISK_INTENSITY = 24.f;
-
// Texture coordinates:
static const LLVector2 TEX00 = LLVector2(0.f, 0.f);
@@ -619,21 +617,6 @@ static inline LLColor3 colorMix(LLColor3 const & left, LLColor3 const & right, F
return (left + ((right - left) * amount));
}
-static inline F32 texture2D(LLPointer<LLImageRaw> const & tex, LLVector2 const & uv)
-{
- U16 w = tex->getWidth();
- U16 h = tex->getHeight();
-
- U16 r = U16(uv[0] * w) % w;
- U16 c = U16(uv[1] * h) % h;
-
- U8 const * imageBuffer = tex->getData();
-
- U8 sample = imageBuffer[r * w + c];
-
- return sample / 255.f;
-}
-
static inline LLColor3 smear(F32 val)
{
return LLColor3(val, val, val);
diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp
index 66c0ace79d..367fa21b91 100755
--- a/indra/newview/llvotree.cpp
+++ b/indra/newview/llvotree.cpp
@@ -396,9 +396,6 @@ void LLVOTree::idleUpdate(LLAgent &agent, const F64 &time)
mTrunkLOD = trunk_LOD;
}
-const F32 TREE_BLEND_MIN = 1.f;
-const F32 TREE_BLEND_RANGE = 1.f;
-
void LLVOTree::render(LLAgent &agent)
{
}
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index a83e2e020e..18cc6d32a5 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -78,10 +78,8 @@
#include "llvocache.h"
#include "llmaterialmgr.h"
-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;
@@ -1222,7 +1220,7 @@ S32 LLVOVolume::computeLODDetail(F32 distance, F32 radius)
{
// We've got LOD in the profile, and in the twist. Use radius.
F32 tan_angle = (LLVOVolume::sLODFactor*radius)/distance;
- cur_detail = LLVolumeLODGroup::getDetailFromTan(llround(tan_angle, 0.01f));
+ cur_detail = LLVolumeLODGroup::getDetailFromTan(ll_round(tan_angle, 0.01f));
}
else
{
@@ -1280,8 +1278,8 @@ BOOL LLVOVolume::calcLOD()
// DON'T Compensate for field of view changing on FOV zoom.
distance *= F_PI/3.f;
- cur_detail = computeLODDetail(llround(distance, 0.01f),
- llround(radius, 0.01f));
+ cur_detail = computeLODDetail(ll_round(distance, 0.01f),
+ ll_round(radius, 0.01f));
if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_LOD_INFO) &&
@@ -1294,7 +1292,7 @@ BOOL LLVOVolume::calcLOD()
if (cur_detail != mLOD)
{
- mAppAngle = llround((F32) atan2( mDrawable->getRadius(), mDrawable->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f);
+ mAppAngle = ll_round((F32) atan2( mDrawable->getRadius(), mDrawable->mDistanceWRTCamera) * RAD_TO_DEG, 0.01f);
mLOD = cur_detail;
return TRUE;
}
@@ -2040,7 +2038,18 @@ S32 LLVOVolume::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID)
S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams)
{
- S32 res = LLViewerObject::setTEMaterialParams(te, pMaterialParams);
+ S32 res = 0;
+
+ if (pMaterialParams && getTEImage(te) && 3 == getTEImage(te)->getComponents() && pMaterialParams->getDiffuseAlphaMode())
+ {
+ LLViewerObject::setTEMaterialID(te, LLMaterialID::null);
+ res = LLViewerObject::setTEMaterialParams(te, NULL);
+ }
+ else
+ {
+ res = LLViewerObject::setTEMaterialParams(te, pMaterialParams);
+ }
+
LL_DEBUGS("MaterialTEs") << "te " << (S32)te << " material " << ((pMaterialParams) ? pMaterialParams->asLLSD() : LLSD("null")) << " res " << res
<< ( LLSelectMgr::getInstance()->getSelection()->contains(const_cast<LLVOVolume*>(this), te) ? " selected" : " not selected" )
<< LL_ENDL;
@@ -4328,7 +4337,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
draw_info->mBump = bump;
draw_info->mShiny = shiny;
- float alpha[4] =
+ static const float alpha[4] =
{
0.00f,
0.25f,
@@ -4517,7 +4526,9 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
//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.
+#if 0
bool pelvisGotSet = false;
+#endif
{
LL_RECORD_BLOCK_TIME(FTM_REBUILD_VOLUME_FACE_LIST);
@@ -4602,53 +4613,12 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
//get drawpool of avatar with rigged face
LLDrawPoolAvatar* pool = get_avatar_drawpool(vobj);
+ // FIXME should this be inside the face loop?
+ // doesn't seem to depend on any per-face state.
if ( pAvatarVO )
{
- LLUUID currentId = vobj->getVolume()->getParams().getSculptID();
- const LLMeshSkinInfo* pSkinData = gMeshRepo.getSkinInfo( currentId, vobj );
- if ( pSkinData )
- {
- const int bindCnt = pSkinData->mAlternateBindMatrix.size();
- if ( bindCnt > 0 )
- {
- const int jointCnt = pSkinData->mJointNames.size();
- const F32 pelvisZOffset = pSkinData->mPelvisOffset;
- 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();
- 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 );
-
- //If joint is a pelvis then handle old/new pelvis to foot values
- if ( lookingForJoint == "mPelvis" )
- {
- if ( !pAvatarVO->hasPelvisOffset() )
- {
- pAvatarVO->setPelvisOffset( true, jointPos, pelvisZOffset );
- pelvisGotSet = true;
- }
- }
- }
- }
- }
- }
- }
+ pAvatarVO->addAttachmentPosOverridesForObject(vobj);
}
-
- //Rebuild body data if we altered joints/pelvis
- if ( pelvisGotSet && pAvatarVO )
- {
- pAvatarVO->postPelvisSetRecalc();
- }
if (pool)
{
@@ -5006,14 +4976,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
}
}
-
-
-
-
-
-
-
-
}
group->mBufferUsage = useage;
@@ -5652,7 +5614,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac
if (material_pass)
{
- U32 pass[] =
+ static const U32 pass[] =
{
LLRenderPass::PASS_MATERIAL,
LLRenderPass::PASS_ALPHA, //LLRenderPass::PASS_MATERIAL_ALPHA,
diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp
index e3419af10d..9ce16a1674 100755
--- a/indra/newview/llvowater.cpp
+++ b/indra/newview/llvowater.cpp
@@ -43,9 +43,6 @@
#include "pipeline.h"
#include "llspatialpartition.h"
-const BOOL gUseRoam = FALSE;
-
-
///////////////////////////////////
template<class T> inline T LERP(T a, T b, F32 factor)
@@ -53,12 +50,6 @@ template<class T> inline T LERP(T a, T b, F32 factor)
return a + (b - a) * factor;
}
-const U32 N_RES_HALF = (N_RES >> 1);
-
-const U32 WIDTH = (N_RES * WAVE_STEP); //128.f //64 // width of wave tile, in meters
-const F32 WAVE_STEP_INV = (1. / WAVE_STEP);
-
-
LLVOWater::LLVOWater(const LLUUID &id,
const LLPCode pcode,
LLViewerRegion *regionp) :
diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp
index ca60b79f9d..fac0fd63ee 100755
--- a/indra/newview/llwearableitemslist.cpp
+++ b/indra/newview/llwearableitemslist.cpp
@@ -364,8 +364,14 @@ void LLPanelAttachmentListItem::updateItem(const std::string& name,
LLViewerInventoryItem* inv_item = getItem();
if (inv_item && isAgentAvatarValid() && gAgentAvatarp->isWearingAttachment(inv_item->getLinkedUUID()))
{
- std::string joint = LLTrans::getString(gAgentAvatarp->getAttachedPointName(inv_item->getLinkedUUID()));
- title_joint = title_joint + " (" + joint + ")";
+ std::string found_name;
+ bool found = gAgentAvatarp->getAttachedPointName(inv_item->getLinkedUUID(),found_name);
+ std::string trans_name = LLTrans::getString(found_name);
+ if (!found)
+ {
+ LL_WARNS() << "invalid attachment joint, err " << found_name << LL_ENDL;
+ }
+ title_joint = title_joint + " (" + trans_name + ")";
}
LLPanelInventoryListItemBase::updateItem(title_joint, item_state);
diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h
index 58a00c5be0..c731a7d6cf 100755
--- a/indra/newview/llwearableitemslist.h
+++ b/indra/newview/llwearableitemslist.h
@@ -382,6 +382,10 @@ class LLWearableItemCreationDateComparator : public LLWearableItemNameComparator
{
LOG_CLASS(LLWearableItemCreationDateComparator);
+public:
+ // clang demands a default ctor here
+ LLWearableItemCreationDateComparator() {}
+
protected:
/*virtual*/ bool doCompare(const LLPanelInventoryListItemBase* item1, const LLPanelInventoryListItemBase* item2) const;
};
diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp
index a8e06511d7..734018cfc2 100755
--- a/indra/newview/llwindowlistener.cpp
+++ b/indra/newview/llwindowlistener.cpp
@@ -44,10 +44,7 @@
#include <typeinfo>
#include <map>
#include <boost/scoped_ptr.hpp>
-#include <boost/lambda/core.hpp>
-#include <boost/lambda/bind.hpp>
-
-namespace bll = boost::lambda;
+#include <boost/bind.hpp>
LLWindowListener::LLWindowListener(LLViewerWindow *window, const KeyboardGetter& kbgetter)
: LLEventAPI("LLWindow", "Inject input events into the LLWindow instance"),
@@ -358,6 +355,30 @@ static WhichButton buttons;
typedef boost::function<bool(LLCoordGL, MASK)> MouseFunc;
+// Wrap a function returning 'void' to return 'true' instead. I'm sure there's
+// a more generic way to accomplish this, but generically handling the
+// arguments seems to require variadic templates and perfect forwarding. (We
+// used to be able to write (boost::lambda::bind(...), true), counting on
+// boost::lambda's comma operator overload, until
+// https://svn.boost.org/trac/boost/ticket/10864. And boost::phoenix doesn't
+// seem to overload comma the same way; or at least not with bind().)
+class MouseFuncTrue
+{
+ typedef boost::function<void(LLCoordGL, MASK)> MouseFuncVoid;
+ MouseFuncVoid mFunc;
+
+public:
+ MouseFuncTrue(const MouseFuncVoid& func):
+ mFunc(func)
+ {}
+
+ bool operator()(LLCoordGL coords, MASK mask) const
+ {
+ mFunc(coords, mask);
+ return true;
+ }
+};
+
static void mouseEvent(const MouseFunc& func, const LLSD& request)
{
// Ensure we send response
@@ -464,11 +485,11 @@ void LLWindowListener::mouseDown(LLSD const & request)
if (actions.valid)
{
// Normally you can pass NULL to an LLWindow* without compiler
- // complaint, but going through boost::lambda::bind() evidently
+ // complaint, but going through boost::bind() evidently
// bypasses that special case: it only knows you're trying to pass an
// int to a pointer. Explicitly cast NULL to the desired pointer type.
- mouseEvent(bll::bind(actions.down, mWindow,
- static_cast<LLWindow*>(NULL), bll::_1, bll::_2),
+ mouseEvent(boost::bind(actions.down, mWindow,
+ static_cast<LLWindow*>(NULL), _1, _2),
request);
}
}
@@ -478,8 +499,8 @@ void LLWindowListener::mouseUp(LLSD const & request)
Actions actions(buttons.lookup(request["button"]));
if (actions.valid)
{
- mouseEvent(bll::bind(actions.up, mWindow,
- static_cast<LLWindow*>(NULL), bll::_1, bll::_2),
+ mouseEvent(boost::bind(actions.up, mWindow,
+ static_cast<LLWindow*>(NULL), _1, _2),
request);
}
}
@@ -489,12 +510,10 @@ void LLWindowListener::mouseMove(LLSD const & request)
// We want to call the same central mouseEvent() routine for
// handleMouseMove() as for button clicks. But handleMouseMove() returns
// void, whereas mouseEvent() accepts a function returning bool -- and
- // uses that bool return. Use (void-lambda-expression, true) to construct
- // a callable that returns bool anyway. Pass 'true' because we expect that
- // our caller will usually treat 'false' as a problem.
- mouseEvent((bll::bind(&LLWindowCallbacks::handleMouseMove, mWindow,
- static_cast<LLWindow*>(NULL), bll::_1, bll::_2),
- true),
+ // uses that bool return. Use MouseFuncTrue to construct a callable that
+ // returns bool anyway.
+ mouseEvent(MouseFuncTrue(boost::bind(&LLWindowCallbacks::handleMouseMove, mWindow,
+ static_cast<LLWindow*>(NULL), _1, _2)),
request);
}
diff --git a/indra/newview/llwlanimator.cpp b/indra/newview/llwlanimator.cpp
index e568638cf6..2142885767 100755
--- a/indra/newview/llwlanimator.cpp
+++ b/indra/newview/llwlanimator.cpp
@@ -242,7 +242,7 @@ std::string LLWLAnimator::timeToString(F32 curTime)
// get hours and minutes
hours = (S32) (24.0 * curTime);
curTime -= ((F32) hours / 24.0f);
- min = llround(24.0f * 60.0f * curTime);
+ min = ll_round(24.0f * 60.0f * curTime);
// handle case where it's 60
if(min == 60)
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index b4e8114a5f..74fb1ec78e 100755
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -70,7 +70,6 @@ U32 gAgentPauseSerialNum = 0;
//
// Constants
//
-const S32 MAX_NUMBER_OF_CLOUDS = 750;
const S32 WORLD_PATCH_SIZE = 16;
extern LLColor4U MAX_WATER_COLOR;
@@ -978,8 +977,8 @@ void LLWorld::updateWaterObjects()
}
// Resize and reshape the water objects
- const S32 water_center_x = center_x + llround((wx + dim[0]) * 0.5f * gDirAxes[dir][0]);
- const S32 water_center_y = center_y + llround((wy + dim[1]) * 0.5f * gDirAxes[dir][1]);
+ const S32 water_center_x = center_x + ll_round((wx + dim[0]) * 0.5f * gDirAxes[dir][0]);
+ const S32 water_center_y = center_y + ll_round((wy + dim[1]) * 0.5f * gDirAxes[dir][1]);
LLVOWater* waterp = mEdgeWaterObjects[dir];
if (!waterp || waterp->isDead())
diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp
index 7cb53a0706..62fad32246 100755
--- a/indra/newview/llworldmapview.cpp
+++ b/indra/newview/llworldmapview.cpp
@@ -67,7 +67,6 @@ const F32 OCEAN_GREEN = (F32)(0x47)/255.f;
const F32 OCEAN_BLUE = (F32)(0x5F)/255.f;
const F32 GODLY_TELEPORT_HEIGHT = 200.f;
-const S32 SCROLL_HINT_WIDTH = 65;
const F32 BIG_DOT_RADIUS = 5.f;
BOOL LLWorldMapView::sHandledLastClick = FALSE;
@@ -420,8 +419,8 @@ void LLWorldMapView::draw()
if (overlayimage)
{
// Inform the fetch mechanism of the size we need
- S32 draw_size = llround(sMapScale);
- overlayimage->setKnownDrawSize(llround(draw_size * LLUI::getScaleFactor().mV[VX]), llround(draw_size * LLUI::getScaleFactor().mV[VY]));
+ S32 draw_size = ll_round(sMapScale);
+ overlayimage->setKnownDrawSize(ll_round(draw_size * LLUI::getScaleFactor().mV[VX]), ll_round(draw_size * LLUI::getScaleFactor().mV[VY]));
// Draw something whenever we have enough info
if (overlayimage->hasGLTexture())
{
@@ -509,7 +508,7 @@ void LLWorldMapView::draw()
drawImage(pos_global, sAvatarYouImage);
LLVector3 pos_map = globalPosToView(pos_global);
- if (!pointInView(llround(pos_map.mV[VX]), llround(pos_map.mV[VY])))
+ if (!pointInView(ll_round(pos_map.mV[VX]), ll_round(pos_map.mV[VY])))
{
drawTracking(pos_global,
lerp(LLColor4::yellow, LLColor4::orange, 0.4f),
@@ -774,8 +773,8 @@ void LLWorldMapView::drawGenericItem(const LLItemInfo& item, LLUIImagePtr image)
void LLWorldMapView::drawImage(const LLVector3d& global_pos, LLUIImagePtr image, const LLColor4& color)
{
LLVector3 pos_map = globalPosToView( global_pos );
- image->draw(llround(pos_map.mV[VX] - image->getWidth() /2.f),
- llround(pos_map.mV[VY] - image->getHeight()/2.f),
+ image->draw(ll_round(pos_map.mV[VX] - image->getWidth() /2.f),
+ ll_round(pos_map.mV[VY] - image->getHeight()/2.f),
color);
}
@@ -784,8 +783,8 @@ void LLWorldMapView::drawImageStack(const LLVector3d& global_pos, LLUIImagePtr i
LLVector3 pos_map = globalPosToView( global_pos );
for(U32 i=0; i<count; i++)
{
- image->draw(llround(pos_map.mV[VX] - image->getWidth() /2.f),
- llround(pos_map.mV[VY] - image->getHeight()/2.f + i*offset),
+ image->draw(ll_round(pos_map.mV[VX] - image->getWidth() /2.f),
+ ll_round(pos_map.mV[VY] - image->getHeight()/2.f + i*offset),
color);
}
}
@@ -959,8 +958,8 @@ void LLWorldMapView::drawTracking(const LLVector3d& pos_global, const LLColor4&
const std::string& label, const std::string& tooltip, S32 vert_offset )
{
LLVector3 pos_local = globalPosToView( pos_global );
- S32 x = llround( pos_local.mV[VX] );
- S32 y = llround( pos_local.mV[VY] );
+ S32 x = ll_round( pos_local.mV[VX] );
+ S32 y = ll_round( pos_local.mV[VY] );
LLFontGL* font = LLFontGL::getFontSansSerifSmall();
S32 text_x = x;
S32 text_y = (S32)(y - sTrackCircleImage->getHeight()/2 - font->getLineHeight());
@@ -1111,8 +1110,8 @@ static void drawDot(F32 x_pixels, F32 y_pixels,
if(-HEIGHT_THRESHOLD <= relative_z && relative_z <= HEIGHT_THRESHOLD)
{
- dot_image->draw(llround(x_pixels) - dot_image->getWidth()/2,
- llround(y_pixels) - dot_image->getHeight()/2,
+ dot_image->draw(ll_round(x_pixels) - dot_image->getWidth()/2,
+ ll_round(y_pixels) - dot_image->getHeight()/2,
color);
}
else
@@ -1167,9 +1166,9 @@ void LLWorldMapView::drawAvatar(F32 x_pixels,
dot_image = sAvatarAboveImage;
}
}
- S32 dot_width = llround(dot_radius * 2.f);
- dot_image->draw(llround(x_pixels - dot_radius),
- llround(y_pixels - dot_radius),
+ S32 dot_width = ll_round(dot_radius * 2.f);
+ dot_image->draw(ll_round(x_pixels - dot_radius),
+ ll_round(y_pixels - dot_radius),
dot_width,
dot_width,
color);
@@ -1196,8 +1195,8 @@ void LLWorldMapView::drawIconName(F32 x_pixels,
const std::string& second_line)
{
const S32 VERT_PAD = 8;
- S32 text_x = llround(x_pixels);
- S32 text_y = llround(y_pixels
+ S32 text_x = ll_round(x_pixels);
+ S32 text_y = ll_round(y_pixels
- BIG_DOT_RADIUS
- VERT_PAD);
@@ -1385,8 +1384,8 @@ void LLWorldMapView::setDirectionPos( LLTextBox* text_box, F32 rotation )
F32 radius = llmin( map_half_height - text_half_height, map_half_width - text_half_width );
text_box->setOrigin(
- llround(map_half_width - text_half_width + radius * cos( rotation )),
- llround(map_half_height - text_half_height + radius * sin( rotation )) );
+ ll_round(map_half_width - text_half_width + radius * cos( rotation )),
+ ll_round(map_half_height - text_half_height + radius * sin( rotation )) );
}
@@ -1434,8 +1433,8 @@ void LLWorldMapView::reshape( S32 width, S32 height, BOOL called_from_parent )
bool LLWorldMapView::checkItemHit(S32 x, S32 y, LLItemInfo& item, LLUUID* id, bool track)
{
LLVector3 pos_view = globalPosToView(item.getGlobalPosition());
- S32 item_x = llround(pos_view.mV[VX]);
- S32 item_y = llround(pos_view.mV[VY]);
+ S32 item_x = ll_round(pos_view.mV[VX]);
+ S32 item_y = ll_round(pos_view.mV[VY]);
if (x < item_x - BIG_DOT_RADIUS) return false;
if (x > item_x + BIG_DOT_RADIUS) return false;
@@ -1599,8 +1598,8 @@ BOOL LLWorldMapView::handleMouseDown( S32 x, S32 y, MASK mask )
{
gFocusMgr.setMouseCapture( this );
- mMouseDownPanX = llround(sPanX);
- mMouseDownPanY = llround(sPanY);
+ mMouseDownPanX = ll_round(sPanX);
+ mMouseDownPanY = ll_round(sPanY);
mMouseDownX = x;
mMouseDownY = y;
sHandledLastClick = TRUE;
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 3dfe1e5992..03712c1065 100755
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -207,15 +207,9 @@ 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;
const F32 BACKLIGHT_DAY_MAGNITUDE_OBJECT = 0.1f;
const F32 BACKLIGHT_NIGHT_MAGNITUDE_OBJECT = 0.08f;
-const S32 MAX_OFFSCREEN_GEOMETRY_CHANGES_PER_FRAME = 10;
-const U32 REFLECTION_MAP_RES = 128;
const U32 DEFERRED_VB_MASK = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_TEXCOORD1;
-// Max number of occluders to search for. JC
-const S32 MAX_OCCLUDER_COUNT = 2;
extern S32 gBoxFrame;
//extern BOOL gHideSelectedObjects;
@@ -410,16 +404,6 @@ static LLPipelineListener sPipelineListener;
static LLCullResult* sCull = NULL;
-static const U32 gl_cube_face[] =
-{
- GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB,
- GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB,
- GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB,
- GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB,
- GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB,
- GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB,
-};
-
void validate_framebuffer_object();
diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml
index ef2f158a86..60f36770bb 100755
--- a/indra/newview/skins/default/xui/en/floater_about.xml
+++ b/indra/newview/skins/default/xui/en/floater_about.xml
@@ -51,44 +51,20 @@
name="credits_panel">
<text
follows="top|left|right"
- height="10"
+ height="20"
layout="topleft"
left="5"
name="linden_intro"
top="10"
width="435"
wrap="true">
-Second Life is brought to you by the Lindens:
- </text>
- <text_editor
- enabled="false"
- follows="top|left"
- height="98"
- bg_readonly_color="Transparent"
- left="5"
- text_color="LtGray"
- max_length="65536"
- name="linden_names"
- 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, Baker
- </text_editor>
- <text
- follows="top|left"
- height="10"
- layout="topleft"
- left="5"
- name="contrib_intro"
- top_pad="10"
- width="435"
- wrap="true">
+Second Life is brought to you by the Lindens,
with open source contributions from:
</text>
<text_editor
enabled="false"
follows="top|left"
- height="98"
+ height="340"
bg_readonly_color="Transparent"
left="5"
text_color="LtGray"
@@ -99,31 +75,6 @@ with open source contributions from:
word_wrap="true">
Dummy Name replaced at run time
</text_editor>
- <text
- follows="top|left"
- height="10"
- layout="topleft"
- left="5"
- name="trans_intro"
- top_pad="10"
- width="435"
- wrap="true">
-and translations from:
- </text>
- <text_editor
- enabled="false"
- follows="top|left"
- height="98"
- bg_readonly_color="Transparent"
- left="5"
- text_color="LtGray"
- max_length="65536"
- name="trans_names"
- top_pad="10"
- width="435"
- word_wrap="true">
-Dummy Name replaced at run time
- </text_editor>
</panel>
<panel
border="true"
@@ -138,7 +89,7 @@ Dummy Name replaced at run time
left="5"
text_color="LtGray"
max_length="65536"
- name="credits_editor"
+ name="licenses_editor"
top="5"
width="435"
word_wrap="true">
diff --git a/indra/newview/skins/default/xui/en/floater_joystick.xml b/indra/newview/skins/default/xui/en/floater_joystick.xml
index 259acccb68..3dfdf8e1a5 100755
--- a/indra/newview/skins/default/xui/en/floater_joystick.xml
+++ b/indra/newview/skins/default/xui/en/floater_joystick.xml
@@ -4,7 +4,7 @@
height="500"
layout="topleft"
name="Joystick"
- help_topic="joystick"
+ help_topic="Viewerhelp:Joystick_Configuration"
title="JOYSTICK CONFIGURATION"
width="569">
<floater.string
diff --git a/indra/newview/skins/default/xui/en/floater_openobject.xml b/indra/newview/skins/default/xui/en/floater_openobject.xml
index bf6e0c4917..912db80bcc 100755
--- a/indra/newview/skins/default/xui/en/floater_openobject.xml
+++ b/indra/newview/skins/default/xui/en/floater_openobject.xml
@@ -3,10 +3,10 @@
legacy_header_height="18"
can_resize="true"
default_tab_group="1"
- height="350"
+ height="370"
layout="topleft"
- min_height="160"
- min_width="280"
+ min_height="190"
+ min_width="285"
name="objectcontents"
help_topic="objectcontents"
save_rect="true"
@@ -31,36 +31,81 @@
background_visible="false"
draw_border="false"
follows="all"
- height="276"
+ height="240"
layout="topleft"
left="10"
name="object_contents"
top_pad="0"
width="284" />
+ <view_border
+ bevel_style="none"
+ follows="bottom|left"
+ height="50"
+ highlight_light_color="0.6 0.6 0.6"
+ layout="topleft"
+ left="10"
+ name="border"
+ top_pad="5"
+ width="270"/>
+ <text
+ follows="bottom|left"
+ height="15"
+ layout="topleft"
+ left="15"
+ name="border_note"
+ text_color="White"
+ top_delta="5">
+ Copy to inventory and wear
+ </text>
+ <button
+ follows="bottom|left"
+ height="23"
+ label="Add to outfit"
+ label_selected="Add to outfit"
+ layout="topleft"
+ left="15"
+ name="copy_and_wear_button"
+ top_pad="3"
+ width="135">
+ <button.commit_callback
+ function="OpenObject.MoveAndWear" />
+ </button>
+ <button
+ follows="bottom|left"
+ height="23"
+ label="Replace outfit"
+ label_selected="Replace outfit"
+ layout="topleft"
+ left_pad="5"
+ name="copy_and_replace_button"
+ width="120">
+ <button.commit_callback
+ function="OpenObject.ReplaceOutfit" />
+ </button>
<button
follows="bottom|left"
height="23"
- label="Copy to inventory"
- label_selected="Copy to inventory"
+ label="Only copy to inventory"
+ label_selected="Only copy to inventory"
layout="topleft"
left="15"
name="copy_to_inventory_button"
tab_group="1"
- top_pad="5"
- width="120">
+ top_pad="9"
+ width="135">
<button.commit_callback
function="OpenObject.MoveToInventory" />
</button>
<button
follows="bottom|left"
height="23"
- label="Copy and add to outfit"
- label_selected="Copy and add to outfit"
+ label="Cancel"
+ label_selected="Cancel"
layout="topleft"
left_pad="5"
- name="copy_and_wear_button"
- width="135">
+ name="cancel_button"
+ width="120">
<button.commit_callback
- function="OpenObject.MoveAndWear" />
+ function="OpenObject.Cancel" />
</button>
</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_pay.xml b/indra/newview/skins/default/xui/en/floater_pay.xml
index 41a7134b1d..9d91f801a6 100755
--- a/indra/newview/skins/default/xui/en/floater_pay.xml
+++ b/indra/newview/skins/default/xui/en/floater_pay.xml
@@ -2,12 +2,12 @@
<floater
legacy_header_height="18"
can_minimize="false"
- height="200"
+ height="186"
layout="topleft"
name="Give Money"
help_topic="give_money"
save_rect="true"
- width="250">
+ width="261">
<string
name="payee_group">
Pay Group
@@ -21,88 +21,129 @@
type="string"
length="1"
follows="left|top"
- font="SansSerifSmall"
height="16"
layout="topleft"
left="10"
- name="payee_name"
- top="25"
- use_ellipses="true"
- width="230">
- Test Name That Is Extremely Long To Check Clipping
+ top="24"
+ name="paying_text"
+ width="180">
+ You are paying:
</text>
- <button
- height="23"
- label="L$1"
- label_selected="L$1"
- layout="topleft"
- left="35"
- name="fastpay 1"
- top_pad="8"
- width="80" />
- <button
- height="23"
- label="L$5"
- label_selected="L$5"
- layout="topleft"
- left_pad="15"
- name="fastpay 5"
- width="80" />
- <button
- height="23"
- label="L$10"
- label_selected="L$10"
- layout="topleft"
- left="35"
- name="fastpay 10"
- top_pad="8"
- width="80" />
- <button
- height="23"
- label="L$20"
- label_selected="L$20"
- layout="topleft"
- left_pad="15"
- name="fastpay 20"
- width="80" />
<text
type="string"
length="1"
follows="left|top"
- height="18"
+ font="SansSerifSmall"
+ height="16"
layout="topleft"
- left="35"
- name="amount text"
- top_pad="8"
+ left="10"
+ top_pad="5"
+ name="payee_name"
+ use_ellipses="true"
width="180">
- Or, choose amount:
+ Test Name That Is Extremely Long To Check Clipping
</text>
- <line_editor
- border_style="line"
- follows="left|top|right"
- height="19"
- top_pad="0"
- layout="topleft"
- left="130"
- max_length_bytes="9"
- name="amount"
- width="80" />
- <button
- enabled="false"
- height="23"
- label="Pay"
- label_selected="Pay"
- layout="topleft"
- left="20"
- name="pay btn"
- top_pad="15"
- width="100" />
- <button
- height="23"
- label="Cancel"
- label_selected="Cancel"
+ <panel
+ border_thickness="0"
+ height="104"
+ label="Search"
layout="topleft"
+ left="0"
+ top_pad="10"
+ help_topic="avatarpicker"
+ name="PatternsPanel"
+ width="120">
+ <button
+ height="23"
+ label="Pay L$ 1"
+ label_selected="Pay L$ 1"
+ layout="topleft"
+ left="10"
+ top="0"
+ name="fastpay 1"
+ width="110" />
+ <button
+ height="23"
+ label="Pay L$ 5"
+ label_selected="Pay L$ 5"
+ layout="topleft"
+ left="10"
+ top_pad="4"
+ name="fastpay 5"
+ width="110" />
+ <button
+ height="23"
+ label="Pay L$ 10"
+ label_selected="Pay L$ 10"
+ layout="topleft"
+ left="10"
+ top_pad="4"
+ name="fastpay 10"
+ width="110" />
+ <button
+ height="23"
+ label="Pay L$ 20"
+ label_selected="Pay L$ 20"
+ layout="topleft"
+ left="10"
+ top_pad="4"
+ name="fastpay 20"
+ width="110" />
+ </panel>
+ <view_border
+ bevel_style="in"
+ width="1"
+ height="104"
left_pad="10"
- name="cancel btn"
- width="100" />
+ layout="topleft" />
+ <panel
+ border_thickness="0"
+ height="104"
+ label="Search"
+ layout="topleft"
+ left_pad="0"
+ name="InputPanel"
+ width="120">
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="18"
+ layout="topleft"
+ left="10"
+ top="0"
+ name="amount text"
+ width="110">
+ Other amount:
+ </text>
+ <line_editor
+ border_style="line"
+ follows="left|top|right"
+ height="19"
+ layout="topleft"
+ left="10"
+ top_pad="0"
+ max_length_bytes="9"
+ name="amount"
+ width="90" />
+ <button
+ enabled="false"
+ height="23"
+ label="Pay"
+ label_selected="Pay"
+ layout="topleft"
+ left="10"
+ top_pad="17"
+ name="pay btn"
+ width="110" />
+ <button
+ height="23"
+ label="Cancel"
+ label_selected="Cancel"
+ layout="topleft"
+ left="10"
+ top_pad="4"
+ name="cancel btn"
+ width="110" />
+ </panel>
</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_pay_object.xml b/indra/newview/skins/default/xui/en/floater_pay_object.xml
index d3a35c2051..f1e27b918e 100755
--- a/indra/newview/skins/default/xui/en/floater_pay_object.xml
+++ b/indra/newview/skins/default/xui/en/floater_pay_object.xml
@@ -2,12 +2,12 @@
<floater
legacy_header_height="18"
can_minimize="false"
- height="225"
+ height="228"
layout="topleft"
name="Give Money"
help_topic="give_money"
save_rect="true"
- width="250">
+ width="261">
<string
name="payee_group">
Pay Group
@@ -16,12 +16,25 @@
name="payee_resident">
Pay Resident
</string>
+
<text
+ type="string"
+ length="1"
follows="left|top"
height="16"
layout="topleft"
left="10"
- top_pad="24"
+ top="24"
+ name="paying_text"
+ width="180">
+ You are paying:
+ </text>
+ <text
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left="10"
+ top_pad="5"
name="payee_name"
use_ellipses="true"
width="225">
@@ -40,7 +53,7 @@
width="180">
Via object:
</text>
- <icon
+ <icon
height="16"
width="16"
image_name="Inv_Object"
@@ -64,78 +77,107 @@
width="188">
My awesome object with a really damn long name
</text>
- <button
- height="23"
- label="L$1"
- label_selected="L$1"
- layout="topleft"
- left="25"
- name="fastpay 1"
- top_pad="8"
- width="80" />
- <button
- height="23"
- label="L$5"
- label_selected="L$5"
- layout="topleft"
- left_pad="15"
- name="fastpay 5"
- width="80" />
- <button
- height="23"
- label="L$10"
- label_selected="L$10"
- layout="topleft"
- left="25"
- name="fastpay 10"
- top_pad="8"
- width="80" />
- <button
- height="23"
- label="L$20"
- label_selected="L$20"
+ <panel
+ border_thickness="0"
+ height="104"
+ label="Search"
layout="topleft"
- left_pad="15"
- name="fastpay 20"
- width="80" />
- <text
- type="string"
- length="1"
- follows="left|top"
- height="14"
- layout="topleft"
- left="25"
- name="amount text"
- top_pad="8"
- width="180">
- Or, choose amount:
- </text>
- <line_editor
- border_style="line"
- follows="left|top|right"
- height="21"
- top_pad="0"
- layout="topleft"
- left="120"
- max_length_bytes="9"
- name="amount"
- width="80" />
- <button
- enabled="false"
- height="23"
- label="Pay"
- label_selected="Pay"
- layout="topleft"
- left="10"
- name="pay btn"
- top_pad="5"
- width="100" />
- <button
- height="23"
- label="Cancel"
- label_selected="Cancel"
+ left="0"
+ top_pad="10"
+ help_topic="avatarpicker"
+ name="PatternsPanel"
+ width="120">
+ <button
+ height="23"
+ label="Pay L$ 1"
+ label_selected="Pay L$ 1"
+ layout="topleft"
+ left="10"
+ top="0"
+ name="fastpay 1"
+ width="110" />
+ <button
+ height="23"
+ label="Pay L$ 5"
+ label_selected="Pay L$ 5"
+ layout="topleft"
+ left="10"
+ top_pad="4"
+ name="fastpay 5"
+ width="110" />
+ <button
+ height="23"
+ label="Pay L$ 10"
+ label_selected="Pay L$ 10"
+ layout="topleft"
+ left="10"
+ top_pad="4"
+ name="fastpay 10"
+ width="110" />
+ <button
+ height="23"
+ label="Pay L$ 20"
+ label_selected="Pay L$ 20"
+ layout="topleft"
+ left="10"
+ top_pad="4"
+ name="fastpay 20"
+ width="110" />
+ </panel>
+ <view_border
+ bevel_style="in"
+ width="1"
+ height="104"
+ left_pad="10"
+ layout="topleft" />
+ <panel
+ border_thickness="0"
+ height="104"
+ label="Search"
layout="topleft"
- left_pad="5"
- name="cancel btn"
- width="100" />
+ left_pad="0"
+ name="InputPanel"
+ width="120">
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="18"
+ layout="topleft"
+ left="10"
+ top="0"
+ name="amount text"
+ width="180">
+ Other amount:
+ </text>
+ <line_editor
+ border_style="line"
+ follows="left|top|right"
+ height="19"
+ layout="topleft"
+ left="10"
+ top_pad="0"
+ max_length_bytes="9"
+ name="amount"
+ width="90" />
+ <button
+ enabled="false"
+ height="23"
+ label="Pay"
+ label_selected="Pay"
+ layout="topleft"
+ left="10"
+ top_pad="17"
+ name="pay btn"
+ width="110" />
+ <button
+ height="23"
+ label="Cancel"
+ label_selected="Cancel"
+ layout="topleft"
+ left="10"
+ top_pad="4"
+ name="cancel btn"
+ width="110" />
+ </panel>
</floater>
diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml
index 6fa45d7d66..7099db63ab 100755
--- a/indra/newview/skins/default/xui/en/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory.xml
@@ -531,7 +531,7 @@
name="Sound Play">
<menu_item_call.on_click
function="Inventory.DoToSelected"
- parameter="open" />
+ parameter="sound_play" />
</menu_item_call>
<menu_item_separator
layout="topleft"
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index c96a0366ca..d737df3941 100755
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -2105,6 +2105,18 @@
parameter="notifications_console" />
</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_check
label="Fast Timers"
name="Fast Timers"
shortcut="control|shift|9"
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 340777faf3..6a9a8727fb 100755
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -5246,6 +5246,19 @@ Warning: The &apos;Pay object&apos; click action has been set, but it will only
<notification
icon="alertmodal.tga"
+ name="PayConfirmation"
+ type="alertmodal">
+ Confirm that you want to pay L$[AMOUNT] to [TARGET].
+ <tag>confirm</tag>
+ <usetemplate
+ ignoretext="Confirm before paying (sums over L$200)"
+ name="okcancelignore"
+ notext="Cancel"
+ yestext="Pay"/>
+ </notification>
+
+ <notification
+ icon="alertmodal.tga"
name="OpenObjectCannotCopy"
type="alertmodal">
There are no items in this object that you are allowed to copy.
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index c0a8866549..51747eb0be 100755
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2307,6 +2307,7 @@ The [[MARKETPLACE_CREATE_STORE_URL] Marketplace store] is returning errors.
<string name="LoadingContents">Loading contents...</string>
<string name="NoContents">No contents</string>
<string name="WornOnAttachmentPoint" value=" (worn on [ATTACHMENT_POINT])" />
+ <string name="AttachmentErrorMessage" value=" ([ATTACHMENT_ERROR])" />
<string name="ActiveGesture" value="[GESLABEL] (active)"/>
<!-- Inventory permissions -->
<string name="PermYes">Yes</string>
@@ -2433,9 +2434,12 @@ The [[MARKETPLACE_CREATE_STORE_URL] Marketplace store] is returning errors.
<string name="Stomach">Stomach</string>
<string name="Left Pec">Left Pec</string>
<string name="Right Pec">Right Pec</string>
- <string name="Neck">Neck</string>
- <string name="Avatar Center">Avatar Center</string>
+ <string name="Neck">Neck</string>
+ <string name="Avatar Center">Avatar Center</string>
<string name="Invalid Attachment">Invalid Attachment Point</string>
+ <string name="ATTACHMENT_MISSING_ITEM">Error: missing item</string>
+ <string name="ATTACHMENT_MISSING_BASE_ITEM">Error: missing base item</string>
+ <string name="ATTACHMENT_NOT_ATTACHED">Error: object is in current outfit but not attached</string>
<!-- Avatar age computation, see LLDateUtil::ageFromDate -->
<string name="YearsMonthsOld">[AGEYEARS] [AGEMONTHS] old</string>
diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp
index adeb848e03..1b0334498e 100755
--- a/indra/newview/tests/lllogininstance_test.cpp
+++ b/indra/newview/tests/lllogininstance_test.cpp
@@ -193,14 +193,6 @@ void LLAppViewer::forceQuit(void) {}
LLAppViewer * LLAppViewer::sInstance = 0;
//-----------------------------------------------------------------------------
-#include "llnotificationsutil.h"
-LLNotificationPtr LLNotificationsUtil::add(const std::string& name,
- const LLSD& substitutions,
- const LLSD& payload,
- boost::function<void (const LLSD&, const LLSD&)> functor) { return LLNotificationPtr((LLNotification*)0); }
-
-
-//-----------------------------------------------------------------------------
#include "llupdaterservice.h"
std::string const & LLUpdaterService::pumpName(void)
@@ -488,8 +480,6 @@ namespace tut
template<> template<>
void lllogininstance_object::test<3>()
{
- skip();
-
set_test_name("Test Mandatory Update User Accepts");
// Part 1 - Mandatory Update, with User accepts response.
@@ -517,8 +507,6 @@ namespace tut
template<> template<>
void lllogininstance_object::test<4>()
{
- skip();
-
set_test_name("Test Mandatory Update User Decline");
// Test connect with update needed.
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 7544fe1c41..176f257005 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -38,7 +38,7 @@ viewer_dir = os.path.dirname(__file__)
# Put it FIRST because some of our build hosts have an ancient install of
# indra.util.llmanifest under their system Python!
sys.path.insert(0, os.path.join(viewer_dir, os.pardir, "lib", "python"))
-from indra.util.llmanifest import LLManifest, main, proper_windows_path, path_ancestors, CHANNEL_VENDOR_BASE, RELEASE_CHANNEL, ManifestError
+from indra.util.llmanifest import LLManifest, main, path_ancestors, CHANNEL_VENDOR_BASE, RELEASE_CHANNEL, ManifestError
try:
from llbase import llsd
except ImportError:
@@ -55,7 +55,6 @@ class ViewerManifest(LLManifest):
def construct(self):
super(ViewerManifest, self).construct()
- self.exclude("*.svn*")
self.path(src="../../scripts/messages/message_template.msg", dst="app_settings/message_template.msg")
self.path(src="../../etc/message.xml", dst="app_settings/message.xml")
@@ -74,26 +73,6 @@ class ViewerManifest(LLManifest):
contributions_path = "../../doc/contributions.txt"
contributor_names = self.extract_names(contributions_path)
self.put_in_file(contributor_names, "contributors.txt", src=contributions_path)
- # include the extracted list of translators
- translations_path = "../../doc/translations.txt"
- translator_names = self.extract_names(translations_path)
- self.put_in_file(translator_names, "translators.txt", src=translations_path)
- # include the list of Lindens (if any)
- # see https://wiki.lindenlab.com/wiki/Generated_Linden_Credits
- linden_names_path = os.getenv("LINDEN_CREDITS")
- if not linden_names_path :
- print "No 'LINDEN_CREDITS' specified in environment, using built-in list"
- else:
- try:
- linden_file = open(linden_names_path,'r')
- except IOError:
- print "No Linden names found at '%s', using built-in list" % linden_names_path
- else:
- # all names should be one line, but the join below also converts to a string
- linden_names = ', '.join(linden_file.readlines())
- self.put_in_file(linden_names, "lindens.txt", src=linden_names_path)
- linden_file.close()
- print "Linden names extracted from '%s'" % linden_names_path
# ... and the entire windlight directory
self.path("windlight")
@@ -107,6 +86,9 @@ class ViewerManifest(LLManifest):
self.path("dictionaries")
self.end_prefix(pkgdir)
+ # include the extracted packages information (see BuildPackagesInfo.cmake)
+ self.path(src=os.path.join(self.args['build'],"packages-info.txt"), dst="packages-info.txt")
+
# CHOP-955: If we have "sourceid" or "viewer_channel" in the
# build process environment, generate it into
# settings_install.xml.
@@ -349,14 +331,18 @@ class Windows_i686_Manifest(ViewerManifest):
def construct(self):
super(Windows_i686_Manifest, self).construct()
+ pkgdir = os.path.join(self.args['build'], os.pardir, 'packages')
+ relpkgdir = os.path.join(pkgdir, "lib", "release")
+ debpkgdir = os.path.join(pkgdir, "lib", "debug")
+
if self.is_packaging_viewer():
# Find secondlife-bin.exe in the 'configuration' dir, then rename it to the result of final_exe.
self.path(src='%s/secondlife-bin.exe' % self.args['configuration'], dst=self.final_exe())
# Plugin host application
- self.path2basename(os.path.join(os.pardir,
- 'llplugin', 'slplugin', self.args['configuration']),
- "slplugin.exe")
+ # The current slplugin package places slplugin.exe right into the
+ # packages base directory.
+ self.path2basename(pkgdir, "slplugin.exe")
self.path2basename("../viewer_components/updater/scripts/windows", "update_install.bat")
# Get shared libs from the shared libs staging directory
@@ -376,15 +362,10 @@ class Windows_i686_Manifest(ViewerManifest):
# Mesh 3rd party libs needed for auto LOD and collada reading
try:
- if self.args['configuration'].lower() == 'debug':
- self.path("libcollada14dom22-d.dll")
- else:
- self.path("libcollada14dom22.dll")
-
self.path("glod.dll")
except RuntimeError, err:
print err.message
- print "Skipping COLLADA and GLOD libraries (assumming linked statically)"
+ print "Skipping GLOD library (assumming linked statically)"
# Get fmodex dll, continue if missing
try:
@@ -443,82 +424,52 @@ class Windows_i686_Manifest(ViewerManifest):
self.path("featuretable_xp.txt")
# Media plugins - QuickTime
- if self.prefix(src='../media_plugins/quicktime/%s' % self.args['configuration'], dst="llplugin"):
- self.path("media_plugin_quicktime.dll")
- self.end_prefix()
-
# Media plugins - WebKit/Qt
- if self.prefix(src='../media_plugins/webkit/%s' % self.args['configuration'], dst="llplugin"):
+ if self.prefix(src=os.path.join(pkgdir, "llplugin"), dst="llplugin"):
+ self.path("media_plugin_quicktime.dll")
self.path("media_plugin_webkit.dll")
- self.end_prefix()
+ self.path("qtcore4.dll")
+ self.path("qtgui4.dll")
+ self.path("qtnetwork4.dll")
+ self.path("qtopengl4.dll")
+ self.path("qtwebkit4.dll")
+ self.path("qtxmlpatterns4.dll")
+
+ # For WebKit/Qt plugin runtimes (image format plugins)
+ if self.prefix(src="imageformats", dst="imageformats"):
+ self.path("qgif4.dll")
+ self.path("qico4.dll")
+ self.path("qjpeg4.dll")
+ self.path("qmng4.dll")
+ self.path("qsvg4.dll")
+ self.path("qtiff4.dll")
+ self.end_prefix()
+
+ # For WebKit/Qt plugin runtimes (codec/character encoding plugins)
+ if self.prefix(src="codecs", dst="codecs"):
+ self.path("qcncodecs4.dll")
+ self.path("qjpcodecs4.dll")
+ self.path("qkrcodecs4.dll")
+ self.path("qtwcodecs4.dll")
+ self.end_prefix()
+
+ self.end_prefix()
# winmm.dll shim
if self.prefix(src='../media_plugins/winmmshim/%s' % self.args['configuration'], dst=""):
self.path("winmm.dll")
self.end_prefix()
-
if self.args['configuration'].lower() == 'debug':
- if self.prefix(src=os.path.join(os.pardir, 'packages', 'lib', 'debug'),
- dst="llplugin"):
+ if self.prefix(src=debpkgdir, dst="llplugin"):
self.path("libeay32.dll")
- self.path("qtcored4.dll")
- self.path("qtguid4.dll")
- self.path("qtnetworkd4.dll")
- self.path("qtopengld4.dll")
- self.path("qtwebkitd4.dll")
- self.path("qtxmlpatternsd4.dll")
self.path("ssleay32.dll")
-
- # For WebKit/Qt plugin runtimes (image format plugins)
- if self.prefix(src="imageformats", dst="imageformats"):
- self.path("qgifd4.dll")
- self.path("qicod4.dll")
- self.path("qjpegd4.dll")
- self.path("qmngd4.dll")
- self.path("qsvgd4.dll")
- self.path("qtiffd4.dll")
- self.end_prefix()
-
- # For WebKit/Qt plugin runtimes (codec/character encoding plugins)
- if self.prefix(src="codecs", dst="codecs"):
- self.path("qcncodecsd4.dll")
- self.path("qjpcodecsd4.dll")
- self.path("qkrcodecsd4.dll")
- self.path("qtwcodecsd4.dll")
- self.end_prefix()
-
self.end_prefix()
+
else:
- if self.prefix(src=os.path.join(os.pardir, 'packages', 'lib', 'release'),
- dst="llplugin"):
+ if self.prefix(src=relpkgdir, dst="llplugin"):
self.path("libeay32.dll")
- self.path("qtcore4.dll")
- self.path("qtgui4.dll")
- self.path("qtnetwork4.dll")
- self.path("qtopengl4.dll")
- self.path("qtwebkit4.dll")
- self.path("qtxmlpatterns4.dll")
self.path("ssleay32.dll")
-
- # For WebKit/Qt plugin runtimes (image format plugins)
- if self.prefix(src="imageformats", dst="imageformats"):
- self.path("qgif4.dll")
- self.path("qico4.dll")
- self.path("qjpeg4.dll")
- self.path("qmng4.dll")
- self.path("qsvg4.dll")
- self.path("qtiff4.dll")
- self.end_prefix()
-
- # For WebKit/Qt plugin runtimes (codec/character encoding plugins)
- if self.prefix(src="codecs", dst="codecs"):
- self.path("qcncodecs4.dll")
- self.path("qjpcodecs4.dll")
- self.path("qkrcodecs4.dll")
- self.path("qtwcodecs4.dll")
- self.end_prefix()
-
self.end_prefix()
# pull in the crash logger and updater from other projects
@@ -631,7 +582,7 @@ class Windows_i686_Manifest(ViewerManifest):
while (not installer_created) and (nsis_attempts > 0):
try:
nsis_attempts-=1;
- self.run_command('"' + proper_windows_path(NSIS_path) + '" ' + self.dst_path_of(tempfile))
+ self.run_command('"' + NSIS_path + '" ' + self.dst_path_of(tempfile))
installer_created=True # if no exception was raised, the codesign worked
except ManifestError, err:
if nsis_attempts:
@@ -668,12 +619,16 @@ class Darwin_i386_Manifest(ViewerManifest):
# copy over the build result (this is a no-op if run within the xcode script)
self.path(self.args['configuration'] + "/Second Life.app", dst="")
+ pkgdir = os.path.join(self.args['build'], os.pardir, 'packages')
+ relpkgdir = os.path.join(pkgdir, "lib", "release")
+ debpkgdir = os.path.join(pkgdir, "lib", "debug")
+
if self.prefix(src="", dst="Contents"): # everything goes in Contents
self.path("Info.plist", dst="Info.plist")
# copy additional libs in <bundle>/Contents/MacOS/
- self.path("../packages/lib/release/libndofdev.dylib", dst="Resources/libndofdev.dylib")
- self.path("../packages/lib/release/libhunspell-1.3.0.dylib", dst="Resources/libhunspell-1.3.0.dylib")
+ self.path(os.path.join(relpkgdir, "libndofdev.dylib"), dst="Resources/libndofdev.dylib")
+ self.path(os.path.join(relpkgdir, "libhunspell-1.3.0.dylib"), dst="Resources/libhunspell-1.3.0.dylib")
if self.prefix(dst="MacOS"):
self.path2basename("../viewer_components/updater/scripts/darwin", "*.py")
@@ -733,7 +688,6 @@ class Darwin_i386_Manifest(ViewerManifest):
print "Skipping %s" % dst
return []
- libdir = "../packages/lib/release"
# dylibs is a list of all the .dylib files we expect to need
# in our bundled sub-apps. For each of these we'll create a
# symlink from sub-app/Contents/Resources to the real .dylib.
@@ -743,7 +697,7 @@ class Darwin_i386_Manifest(ViewerManifest):
"llcommon",
self.args['configuration'],
libfile),
- os.path.join(libdir, libfile)),
+ os.path.join(relpkgdir, libfile)),
dst=libfile)
for libfile in (
@@ -754,7 +708,7 @@ class Darwin_i386_Manifest(ViewerManifest):
"libexception_handler.dylib",
"libGLOD.dylib",
):
- dylibs += path_optional(os.path.join(libdir, libfile), libfile)
+ dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile)
# SLVoice and vivox lols, no symlinks needed
for libfile in (
@@ -766,38 +720,41 @@ class Darwin_i386_Manifest(ViewerManifest):
'ca-bundle.crt',
'SLVoice',
):
- self.path2basename(libdir, libfile)
+ self.path2basename(relpkgdir, libfile)
# dylibs that vary based on configuration
if self.args['configuration'].lower() == 'debug':
for libfile in (
"libfmodexL.dylib",
):
- dylibs += path_optional(os.path.join("../packages/lib/debug",
- libfile), libfile)
+ dylibs += path_optional(os.path.join(debpkgdir, libfile), libfile)
else:
for libfile in (
"libfmodex.dylib",
):
- dylibs += path_optional(os.path.join("../packages/lib/release",
- libfile), libfile)
+ dylibs += path_optional(os.path.join(relpkgdir, libfile), libfile)
# our apps
- for app_bld_dir, app in (("mac_crash_logger", "mac-crash-logger.app"),
+ for app_bld_dir, app in ((os.path.join(os.pardir,
+ "mac_crash_logger",
+ self.args['configuration']),
+ "mac-crash-logger.app"),
# plugin launcher
- (os.path.join("llplugin", "slplugin"), "SLPlugin.app"),
+ (pkgdir, "SLPlugin.app"),
):
- self.path2basename(os.path.join(os.pardir,
- app_bld_dir, self.args['configuration']),
- app)
+ self.path2basename(app_bld_dir, app)
# our apps dependencies on shared libs
# for each app, for each dylib we collected in dylibs,
# create a symlink to the real copy of the dylib.
resource_path = self.dst_path_of(os.path.join(app, "Contents", "Resources"))
for libfile in dylibs:
- symlinkf(os.path.join(os.pardir, os.pardir, os.pardir, libfile),
- os.path.join(resource_path, libfile))
+ src = os.path.join(os.pardir, os.pardir, os.pardir, libfile)
+ dst = os.path.join(resource_path, libfile)
+ try:
+ symlinkf(src, dst)
+ except OSError as err:
+ print "Can't symlink %s -> %s: %s" % (src, dst, err)
# 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',
@@ -814,26 +771,24 @@ class Darwin_i386_Manifest(ViewerManifest):
'libQtWebKit.4.7.1.dylib',
'libQtXml.4.dylib',
'libQtXml.4.7.1.dylib'):
- self.path2basename("../packages/lib/release", libfile)
+ self.path2basename(relpkgdir, 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"):
+ if self.prefix(src=os.path.join(pkgdir, "llplugin/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"):
+ if self.prefix(src=os.path.join(pkgdir, "llplugin/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")
+ if self.prefix(src=os.path.join(pkgdir, "llplugin"), dst="llplugin"):
+ self.path("media_plugin_quicktime.dylib")
+ self.path("media_plugin_webkit.dylib")
self.end_prefix("llplugin")
self.end_prefix("Resources")
@@ -858,48 +813,6 @@ class Darwin_i386_Manifest(ViewerManifest):
def package_finish(self):
global CHANNEL_VENDOR_BASE
- # Sign the app if requested.
- if 'signature' in self.args:
- identity = self.args['signature']
- if identity == '':
- identity = 'Developer ID Application'
-
- # Look for an environment variable set via build.sh when running in Team City.
- try:
- build_secrets_checkout = os.environ['build_secrets_checkout']
- except KeyError:
- pass
- else:
- # variable found so use it to unlock keyvchain followed by codesign
- home_path = os.environ['HOME']
- keychain_pwd_path = os.path.join(build_secrets_checkout,'code-signing-osx','password.txt')
- keychain_pwd = open(keychain_pwd_path).read().rstrip()
-
- self.run_command('security unlock-keychain -p "%s" "%s/Library/Keychains/viewer.keychain"' % ( keychain_pwd, home_path ) )
- signed=False
- sign_attempts=3
- sign_retry_wait=15
- while (not signed) and (sign_attempts > 0):
- try:
- sign_attempts-=1;
- self.run_command(
- 'codesign --verbose --force --keychain "%(home_path)s/Library/Keychains/viewer.keychain" --sign %(identity)r %(bundle)r' % {
- 'home_path' : home_path,
- 'identity': identity,
- 'bundle': self.get_dst_prefix()
- })
- signed=True # if no exception was raised, the codesign worked
- except ManifestError, err:
- if sign_attempts:
- print >> sys.stderr, "codesign failed, waiting %d seconds before retrying" % sign_retry_wait
- time.sleep(sign_retry_wait)
- sign_retry_wait*=2
- else:
- print >> sys.stderr, "Maximum codesign attempts exceeded; giving up"
- raise
-
- imagename="SecondLife_" + '_'.join(self.args['version'])
-
# MBW -- If the mounted volume name changes, it breaks the .DS_Store's background image and icon positioning.
# If we really need differently named volumes, we'll need to create multiple DS_Store file images, or use some other trick.
@@ -981,6 +894,56 @@ class Darwin_i386_Manifest(ViewerManifest):
# Set the disk image root's custom icon bit
self.run_command('SetFile -a C %r' % volpath)
+
+ # Sign the app if requested;
+ # do this in the copy that's in the .dmg so that the extended attributes used by
+ # the signature are preserved; moving the files using python will leave them behind
+ # and invalidate the signatures.
+ if 'signature' in self.args:
+ app_in_dmg=os.path.join(volpath,self.app_name()+".app")
+ print "Attempting to sign '%s'" % app_in_dmg
+ identity = self.args['signature']
+ if identity == '':
+ identity = 'Developer ID Application'
+
+ # Look for an environment variable set via build.sh when running in Team City.
+ try:
+ build_secrets_checkout = os.environ['build_secrets_checkout']
+ except KeyError:
+ pass
+ else:
+ # variable found so use it to unlock keychain followed by codesign
+ home_path = os.environ['HOME']
+ keychain_pwd_path = os.path.join(build_secrets_checkout,'code-signing-osx','password.txt')
+ keychain_pwd = open(keychain_pwd_path).read().rstrip()
+
+ self.run_command('security unlock-keychain -p "%s" "%s/Library/Keychains/viewer.keychain"' % ( keychain_pwd, home_path ) )
+ signed=False
+ sign_attempts=3
+ sign_retry_wait=15
+ while (not signed) and (sign_attempts > 0):
+ try:
+ sign_attempts-=1;
+ self.run_command(
+ 'codesign --verbose --deep --force --keychain "%(home_path)s/Library/Keychains/viewer.keychain" --sign %(identity)r %(bundle)r' % {
+ 'home_path' : home_path,
+ 'identity': identity,
+ 'bundle': app_in_dmg
+ })
+ signed=True # if no exception was raised, the codesign worked
+ except ManifestError, err:
+ if sign_attempts:
+ print >> sys.stderr, "codesign failed, waiting %d seconds before retrying" % sign_retry_wait
+ time.sleep(sign_retry_wait)
+ sign_retry_wait*=2
+ else:
+ print >> sys.stderr, "Maximum codesign attempts exceeded; giving up"
+ raise
+ self.run_command('spctl -a -texec -vv %(bundle)r' % { 'bundle': app_in_dmg })
+
+ imagename="SecondLife_" + '_'.join(self.args['version'])
+
+
finally:
# Unmount the image even if exceptions from any of the above
self.run_command('hdiutil detach -force %r' % devfile)
@@ -995,6 +958,11 @@ class Darwin_i386_Manifest(ViewerManifest):
class LinuxManifest(ViewerManifest):
def construct(self):
super(LinuxManifest, self).construct()
+
+ pkgdir = os.path.join(self.args['build'], os.pardir, 'packages')
+ relpkgdir = os.path.join(pkgdir, "lib", "release")
+ debpkgdir = os.path.join(pkgdir, "lib", "debug")
+
self.path("licenses-linux.txt","licenses.txt")
if self.prefix("linux_tools", dst=""):
self.path("client-readme.txt","README-linux.txt")
@@ -1013,7 +981,7 @@ class LinuxManifest(ViewerManifest):
if self.prefix(src="", dst="bin"):
self.path("secondlife-bin","do-not-directly-run-secondlife-bin")
self.path("../linux_crash_logger/linux-crash-logger","linux-crash-logger.bin")
- self.path2basename("../llplugin/slplugin", "SLPlugin")
+ self.path2basename(pkgdir, "SLPlugin")
self.path2basename("../viewer_components/updater/scripts/linux", "update_install")
self.end_prefix("bin")
@@ -1033,9 +1001,9 @@ class LinuxManifest(ViewerManifest):
self.end_prefix(icon_path)
# plugins
- if self.prefix(src="", dst="bin/llplugin"):
- self.path2basename("../media_plugins/webkit", "libmedia_plugin_webkit.so")
- self.path("../media_plugins/gstreamer010/libmedia_plugin_gstreamer010.so", "libmedia_plugin_gstreamer.so")
+ if self.prefix(src=os.path.join(pkgdir, "llplugin"), dst="bin/llplugin"):
+ self.path("libmedia_plugin_webkit.so")
+ self.path("libmedia_plugin_gstreamer.so")
self.end_prefix("bin/llplugin")
# llcommon
@@ -1097,7 +1065,11 @@ class Linux_i686_Manifest(LinuxManifest):
def construct(self):
super(Linux_i686_Manifest, self).construct()
- if self.prefix("../packages/lib/release", dst="lib"):
+ pkgdir = os.path.join(self.args['build'], os.pardir, 'packages')
+ relpkgdir = os.path.join(pkgdir, "lib", "release")
+ debpkgdir = os.path.join(pkgdir, "lib", "debug")
+
+ if self.prefix(relpkgdir, dst="lib"):
self.path("libapr-1.so")
self.path("libapr-1.so.0")
self.path("libapr-1.so.0.4.5")
@@ -1117,7 +1089,7 @@ class Linux_i686_Manifest(LinuxManifest):
self.path("libfusion-1.4.so.5")
self.path("libdirect-1.4.so.5*")
self.path("libhunspell-1.3.so*")
- self.path("libalut.so")
+ self.path("libalut.so*")
self.path("libopenal.so", "libopenal.so.1")
self.path("libopenal.so", "libvivoxoal.so.1") # vivox's sdk expects this soname
# KLUDGE: As of 2012-04-11, the 'fontconfig' package installs
@@ -1160,10 +1132,10 @@ class Linux_i686_Manifest(LinuxManifest):
self.end_prefix("lib")
# Vivox runtimes
- if self.prefix(src="../packages/lib/release", dst="bin"):
+ if self.prefix(src=relpkgdir, dst="bin"):
self.path("SLVoice")
self.end_prefix()
- if self.prefix(src="../packages/lib/release", dst="lib"):
+ if self.prefix(src=relpkgdir, 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
@@ -1172,7 +1144,7 @@ class Linux_i686_Manifest(LinuxManifest):
self.end_prefix("lib")
# plugin runtime
- if self.prefix(src="../packages/lib/release", dst="lib"):
+ if self.prefix(src=os.path.join(pkgdir, "lib"), dst="lib"):
self.path("libQtCore.so*")
self.path("libQtGui.so*")
self.path("libQtNetwork.so*")
@@ -1183,7 +1155,8 @@ class Linux_i686_Manifest(LinuxManifest):
self.end_prefix("lib")
# For WebKit/Qt plugin runtimes (image format plugins)
- if self.prefix(src="../packages/plugins/imageformats", dst="bin/llplugin/imageformats"):
+ if self.prefix(src=os.path.join(pkgdir, "llplugin", "imageformats"),
+ dst="bin/llplugin/imageformats"):
self.path("libqgif.so")
self.path("libqico.so")
self.path("libqjpeg.so")
@@ -1193,7 +1166,8 @@ class Linux_i686_Manifest(LinuxManifest):
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"):
+ if self.prefix(src=os.path.join(pkgdir, "llplugin", "codecs"),
+ dst="bin/llplugin/codecs"):
self.path("libqcncodecs.so")
self.path("libqjpcodecs.so")
self.path("libqkrcodecs.so")
diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt
index 62b1d9db62..01d1d830a2 100755
--- a/indra/test/CMakeLists.txt
+++ b/indra/test/CMakeLists.txt
@@ -1,6 +1,6 @@
# -*- cmake -*-
-project (test)
+project (lltest)
include(00-Common)
include(LLCommon)
@@ -80,9 +80,9 @@ set_source_files_properties(${test_HEADER_FILES}
list(APPEND test_SOURCE_FILES ${test_HEADER_FILES})
-add_executable(test ${test_SOURCE_FILES})
+add_executable(lltest ${test_SOURCE_FILES})
-target_link_libraries(test
+target_link_libraries(lltest
${LLDATABASE_LIBRARIES}
${LLINVENTORY_LIBRARIES}
${LLMESSAGE_LIBRARIES}
@@ -102,14 +102,14 @@ target_link_libraries(test
)
if (WINDOWS)
- set_target_properties(test
+ set_target_properties(lltest
PROPERTIES
LINK_FLAGS "/NODEFAULTLIB:LIBCMT"
LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\""
)
endif (WINDOWS)
-get_target_property(TEST_EXE test LOCATION)
+set(TEST_EXE $<TARGET_FILE:lltest>)
SET_TEST_PATH(DYLD_LIBRARY_PATH)
@@ -122,7 +122,7 @@ LL_TEST_COMMAND(command
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cpp_tests_ok.txt
COMMAND ${command}
- DEPENDS test
+ DEPENDS lltest
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "C++ unit tests"
)
diff --git a/indra/test/llbuffer_tut.cpp b/indra/test/llbuffer_tut.cpp
index a25fdebb7f..9b8aae6a73 100755
--- a/indra/test/llbuffer_tut.cpp
+++ b/indra/test/llbuffer_tut.cpp
@@ -27,6 +27,7 @@
*/
#include <tut/tut.hpp>
+
#include "linden_common.h"
#include "lltut.h"
#include "llbuffer.h"
diff --git a/indra/test/llevents_tut.cpp b/indra/test/llevents_tut.cpp
index a9114075fc..16edab6282 100755
--- a/indra/test/llevents_tut.cpp
+++ b/indra/test/llevents_tut.cpp
@@ -48,10 +48,10 @@
#include <boost/shared_ptr.hpp>
#include <boost/assign/list_of.hpp>
// other Linden headers
+#include "tests/listener.h" // must PRECEDE lltut.h
#include "lltut.h"
#include "catch_and_store_what_in.h"
#include "stringize.h"
-#include "tests/listener.h"
using boost::assign::list_of;
diff --git a/indra/test/llpermissions_tut.cpp b/indra/test/llpermissions_tut.cpp
index 8d8d47a667..fa4b085fd3 100755
--- a/indra/test/llpermissions_tut.cpp
+++ b/indra/test/llpermissions_tut.cpp
@@ -28,7 +28,9 @@
#include <tut/tut.hpp>
#include "linden_common.h"
+
#include "lltut.h"
+
#include "message.h"
#include "llpermissions.h"
diff --git a/indra/test/llsd_new_tut.cpp b/indra/test/llsd_new_tut.cpp
index 03df1d339b..458df3361e 100755
--- a/indra/test/llsd_new_tut.cpp
+++ b/indra/test/llsd_new_tut.cpp
@@ -33,18 +33,7 @@
#include "llsdtraits.h"
#include "llstring.h"
-#if LL_WINDOWS
-#include <float.h>
-namespace
-{
- int fpclassify(double x)
- {
- return _fpclass(x);
- }
-}
-#else
using std::fpclassify;
-#endif
namespace tut
{
@@ -112,15 +101,15 @@ namespace tut
SDTestGroup sdTestGroup("LLSD(new)");
- template<> template<>
- void SDTestObject::test<1>()
- // construction and test of undefined
- {
- SDCleanupCheck check;
-
- LLSD u;
- ensure("is undefined", u.isUndefined());
- }
+ // template<> template<>
+ // void SDTestObject::test<1>()
+ // // construction and test of undefined
+ // {
+ // SDCleanupCheck check;
+
+ // LLSD u;
+ // ensure("is undefined", u.isUndefined());
+ // }
template<> template<>
void SDTestObject::test<2>()
@@ -277,8 +266,18 @@ namespace tut
v = 0.5; checkConversions("point5", v, true, 0, 0.5, "0.5");
v = 0.9; checkConversions("point9", v, true, 0, 0.9, "0.9");
v = -3.9; checkConversions("neg3dot9", v, true, -3, -3.9, "-3.9");
- v = sqrt(-1.0); checkConversions("NaN", v, false, 0, sqrt(-1.0), "nan");
-
+ // Get rid of NaN test. First, some libraries don't reliably return
+ // NaN for sqrt(-1.0) -- meaning that I don't even know how to
+ // portably, reliably produce a NaN value. Second, we observe failures
+ // on different platforms in the asString() test. But LLSD's
+ // ImplReal::asString() does not itself recognize NaN! It merely
+ // passes the value through to llformat(), which passes it through to
+ // the library vsnprintf(). That is, even when we do produce NaN,
+ // we're not testing any LLSD code: we're testing the local library's
+ // vsnprintf() function, which (empirically) produces idiosyncratic
+ // results. This is just not a good test case.
+// v = sqrt(-1.0); checkConversions("NaN", v, false, 0, sqrt(-1.0), "nan");
+
v = ""; checkConversions("empty", v, false, 0, 0.0, "");
v = "0"; checkConversions("digit0", v, true, 0, 0.0, "0");
v = "10"; checkConversions("digit10", v, true, 10, 10.0, "10");
diff --git a/indra/test/lltranscode_tut.cpp b/indra/test/lltranscode_tut.cpp
index 2431afad27..3fce6e0e2b 100755
--- a/indra/test/lltranscode_tut.cpp
+++ b/indra/test/lltranscode_tut.cpp
@@ -49,9 +49,6 @@ namespace tut
template<> template<>
void LLTranscodeTestObject::test<1>()
{
-#if LL_WINDOWS
- skip("Windows APR libs can't transcode.");
-#endif
// Test utf8
std::stringstream input;
std::stringstream output;
diff --git a/indra/test/lltut.cpp b/indra/test/lltut.cpp
index c43a8f0c7d..5a8ee87afd 100755
--- a/indra/test/lltut.cpp
+++ b/indra/test/lltut.cpp
@@ -38,43 +38,44 @@
namespace tut
{
- void ensure_equals(const char* msg, const LLDate& actual,
+ void ensure_equals(const std::string& msg, const LLDate& actual,
const LLDate& expected)
{
ensure_equals(msg,
actual.secondsSinceEpoch(), expected.secondsSinceEpoch());
}
- void ensure_equals(const char* msg, const LLURI& actual,
+ void ensure_equals(const std::string& msg, const LLURI& actual,
const LLURI& expected)
{
ensure_equals(msg,
actual.asString(), expected.asString());
}
- void ensure_equals(const char* msg,
- const std::vector<U8>& actual, const std::vector<U8>& expected)
+ // The lexical param types here intentionally diverge from the declaration
+ // in our header file. In lltut.h, LLSD is only a forward-declared type;
+ // we have no access to its LLSD::Binary nested type, and so must restate
+ // it explicitly to declare this overload. However, an overload that does
+ // NOT match LLSD::Binary does us no good whatsoever: it would never be
+ // engaged. Stating LLSD::Binary for this definition at least means that
+ // if the LLSD::Binary type ever diverges from what we expect in lltut.h,
+ // that divergence will produce an error: no definition will match that
+ // declaration.
+ void ensure_equals(const std::string& msg,
+ const LLSD::Binary& actual, const LLSD::Binary& expected)
{
- std::string s(msg);
+ ensure_equals(msg + " size", actual.size(), expected.size());
- ensure_equals(s + " size", actual.size(), expected.size());
-
- std::vector<U8>::const_iterator i, j;
+ LLSD::Binary::const_iterator i, j;
int k;
for (i = actual.begin(), j = expected.begin(), k = 0;
i != actual.end();
++i, ++j, ++k)
{
- ensure_equals(s + " field", *i, *j);
+ ensure_equals(msg + " field", *i, *j);
}
}
- void ensure_equals(const char* m, const LLSD& actual,
- const LLSD& expected)
- {
- ensure_equals(std::string(m), actual, expected);
- }
-
void ensure_equals(const std::string& msg, const LLSD& actual,
const LLSD& expected)
{
@@ -158,8 +159,8 @@ namespace tut
if( actual.find(expectedStart, 0) != 0 )
{
std::stringstream ss;
- ss << msg << ": " << "expected to find " << expectedStart
- << " at start of actual " << actual;
+ ss << msg << ": " << "expected to find '" << expectedStart
+ << "' at start of actual '" << actual << "'";
throw failure(ss.str().c_str());
}
}
@@ -172,8 +173,8 @@ namespace tut
!= (actual.size() - expectedEnd.size()) )
{
std::stringstream ss;
- ss << msg << ": " << "expected to find " << expectedEnd
- << " at end of actual " << actual;
+ ss << msg << ": " << "expected to find '" << expectedEnd
+ << "' at end of actual '" << actual << "'";
throw failure(ss.str().c_str());
}
}
@@ -184,8 +185,8 @@ namespace tut
if( actual.find(expectedSubString, 0) == std::string::npos )
{
std::stringstream ss;
- ss << msg << ": " << "expected to find " << expectedSubString
- << " in actual " << actual;
+ ss << msg << ": " << "expected to find '" << expectedSubString
+ << "' in actual '" << actual << "'";
throw failure(ss.str().c_str());
}
}
diff --git a/indra/test/lltut.h b/indra/test/lltut.h
index 243e869be7..9835565bb6 100755
--- a/indra/test/lltut.h
+++ b/indra/test/lltut.h
@@ -30,8 +30,6 @@
#define LL_LLTUT_H
#include "is_approx_equal_fraction.h" // instead of llmath.h
-
-#include <tut/tut.hpp>
#include <cstring>
class LLDate;
@@ -40,6 +38,55 @@ class LLURI;
namespace tut
{
+ void ensure_equals(const std::string& msg,
+ const LLDate& actual, const LLDate& expected);
+
+ void ensure_equals(const std::string& msg,
+ const LLURI& actual, const LLURI& expected);
+
+ // std::vector<U8> is the current definition of LLSD::Binary. Because
+ // we're only forward-declaring LLSD in this header file, we can't
+ // directly reference that nested type. If the build complains that
+ // there's no definition for this declaration, it could be that
+ // LLSD::Binary has changed, and that this declaration must be adjusted to
+ // match.
+ void ensure_equals(const std::string& msg,
+ const std::vector<U8>& actual, const std::vector<U8>& expected);
+
+ void ensure_equals(const std::string& msg,
+ const LLSD& actual, const LLSD& expected);
+
+ void ensure_starts_with(const std::string& msg,
+ const std::string& actual, const std::string& expectedStart);
+
+ void ensure_ends_with(const std::string& msg,
+ const std::string& actual, const std::string& expectedEnd);
+
+ void ensure_contains(const std::string& msg,
+ const std::string& actual, const std::string& expectedSubString);
+
+ void ensure_does_not_contain(const std::string& msg,
+ const std::string& actual, const std::string& expectedSubString);
+}
+
+// This is an odd place to #include an important contributor -- but the usual
+// rules are reversed here. Instead of the overloads above referencing tut.hpp
+// features, we need calls in tut.hpp template functions to dispatch to our
+// overloads declared above.
+
+// turn off warnings about unused functions from clang for tut package
+#if __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wunused-function"
+#endif
+#include <tut/tut.hpp>
+#if __clang__
+#pragma clang diagnostic pop
+#endif
+
+// The functions BELOW this point actually consume tut.hpp functionality.
+namespace tut
+{
inline void ensure_approximately_equals(const char* msg, F64 actual, F64 expected, U32 frac_bits)
{
if(!is_approx_equal_fraction(actual, expected, frac_bits))
@@ -107,40 +154,6 @@ namespace tut
{
ensure_not_equals(NULL, actual, expected);
}
-
-
- template <class T,class Q>
- void ensure_equals(const std::string& msg,
- const Q& actual,const T& expected)
- { ensure_equals(msg.c_str(), actual, expected); }
-
- void ensure_equals(const char* msg,
- const LLDate& actual, const LLDate& expected);
-
- void ensure_equals(const char* msg,
- const LLURI& actual, const LLURI& expected);
-
- void ensure_equals(const char* msg,
- const std::vector<U8>& actual, const std::vector<U8>& expected);
-
- void ensure_equals(const char* msg,
- const LLSD& actual, const LLSD& expected);
-
- void ensure_equals(const std::string& msg,
- const LLSD& actual, const LLSD& expected);
-
- void ensure_starts_with(const std::string& msg,
- const std::string& actual, const std::string& expectedStart);
-
- void ensure_ends_with(const std::string& msg,
- const std::string& actual, const std::string& expectedEnd);
-
- void ensure_contains(const std::string& msg,
- const std::string& actual, const std::string& expectedSubString);
-
- void ensure_does_not_contain(const std::string& msg,
- const std::string& actual, const std::string& expectedSubString);
}
-
#endif // LL_LLTUT_H
diff --git a/indra/test/namedtempfile.h b/indra/test/namedtempfile.h
index 6069064627..7d59cad32c 100755
--- a/indra/test/namedtempfile.h
+++ b/indra/test/namedtempfile.h
@@ -17,8 +17,8 @@
#include "apr_file_io.h"
#include <string>
#include <boost/function.hpp>
-#include <boost/lambda/lambda.hpp>
-#include <boost/lambda/bind.hpp>
+#include <boost/phoenix/core/argument.hpp>
+#include <boost/phoenix/operator/bitwise.hpp>
#include <boost/noncopyable.hpp>
#include <iostream>
#include <sstream>
@@ -34,19 +34,19 @@ public:
NamedTempFile(const std::string& pfx, const std::string& content, apr_pool_t* pool=gAPRPoolp):
mPool(pool)
{
- createFile(pfx, boost::lambda::_1 << content);
+ createFile(pfx, boost::phoenix::placeholders::arg1 << content);
}
// Disambiguate when passing string literal
NamedTempFile(const std::string& pfx, const char* content, apr_pool_t* pool=gAPRPoolp):
mPool(pool)
{
- createFile(pfx, boost::lambda::_1 << content);
+ createFile(pfx, boost::phoenix::placeholders::arg1 << content);
}
// Function that accepts an ostream ref and (presumably) writes stuff to
// it, e.g.:
- // (boost::lambda::_1 << "the value is " << 17 << '\n')
+ // (boost::phoenix::placeholders::arg1 << "the value is " << 17 << '\n')
typedef boost::function<void(std::ostream&)> Streamer;
NamedTempFile(const std::string& pfx, const Streamer& func, apr_pool_t* pool=gAPRPoolp):
diff --git a/indra/test_apps/llfbconnecttest/CMakeLists.txt b/indra/test_apps/llfbconnecttest/CMakeLists.txt
index 512bf202ae..25aaebb783 100644
--- a/indra/test_apps/llfbconnecttest/CMakeLists.txt
+++ b/indra/test_apps/llfbconnecttest/CMakeLists.txt
@@ -109,27 +109,27 @@ else (DARWIN)
)
endif (DARWIN)
-get_target_property(BUILT_SLPLUGIN SLPlugin LOCATION)
+set(BUILT_SLPLUGIN $<TARGET_FILE:SLPlugin>)
add_custom_command(TARGET llfbconnecttest POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_SLPLUGIN} ${PLUGINS_DESTINATION_DIR}
DEPENDS ${BUILT_SLPLUGIN}
)
-get_target_property(BUILT_LLCOMMON llcommon LOCATION)
+set(BUILT_LLCOMMON $<TARGET_FILE:llcommon>)
add_custom_command(TARGET llfbconnecttest POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_LLCOMMON} ${PLUGINS_DESTINATION_DIR}
DEPENDS ${BUILT_LLCOMMON}
)
-get_target_property(BUILT_WEBKIT_PLUGIN media_plugin_webkit LOCATION)
+set(BUILT_WEBKIT_PLUGIN $<TARGET_FILE:media_plugin_webkit>)
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)
+set(BUILT_LLFBCONNECTTEST $<TARGET_FILE:llfbconnecttest>)
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}
diff --git a/indra/test_apps/llfbconnecttest/llfbconnecttest.h b/indra/test_apps/llfbconnecttest/llfbconnecttest.h
index 6f442a55b3..77e4d096d0 100644
--- a/indra/test_apps/llfbconnecttest/llfbconnecttest.h
+++ b/indra/test_apps/llfbconnecttest/llfbconnecttest.h
@@ -144,43 +144,14 @@ class LLFBConnectTest : public LLPluginClassMediaOwner
float mDistanceCameraToSelectedGeometry;
- int mIdControlAddPanel;
- int mIdControlRemPanel;
-
std::vector< std::pair< std::string, std::string > > mBookmarks;
GLUI_Listbox* mBookmarkList;
int mIdBookmarks;
int mIdUrlEdit;
GLUI_EditText* mUrlEdit;
- //int mIdUrlInitHistoryEdit;
- //GLUI_EditText* mUrlInitHistoryEdit;
int mSelBookmark;
- //int mIdRandomPanelCount;
- //int mRandomPanelCount;
- //int mIdRandomBookmarks;
- //int mRandomBookmarks;
- //int mIdDisableTimeout;
- //int mDisableTimeout;
- //int mIdUsePluginReadThread;
- //int mUsePluginReadThread;
- //int mIdLargePanelSpacing;
- //int mLargePanelSpacing;
- //int mIdControlCrashPlugin;
- //int mIdControlHangPlugin;
- int mIdControlExitApp;
- //GLUI* mGluiMediaTimeControlWindow;
- //int mIdMediaTimeControlPlay;
- //int mIdMediaTimeControlLoop;
- //int mIdMediaTimeControlPause;
- //int mIdMediaTimeControlStop;
- //int mIdMediaTimeControlSeek;
- //int mIdMediaTimeControlVolume;
- //int mMediaTimeControlVolume;
- //int mIdMediaTimeControlSeekSeconds;
- //int mMediaTimeControlSeekSeconds;
- //int mIdMediaTimeControlRewind;
- //int mIdMediaTimeControlFastForward;
+ int mIdControlExitApp;
GLUI* mGluiMediaBrowserControlWindow;
int mIdMediaBrowserControlBack;
@@ -188,16 +159,11 @@ class LLFBConnectTest : public LLPluginClassMediaOwner
int mIdMediaBrowserControlStop;
int mIdMediaBrowserControlForward;
GLUI_Button* mMediaBrowserControlForwardButton;
- bool mGluiMediaTimeControlWindowFlag;
bool mGluiMediaBrowserControlWindowFlag;
bool mMediaBrowserControlBackButtonFlag;
bool mMediaBrowserControlForwardButtonFlag;
int mIdMediaBrowserControlHome;
int mIdMediaBrowserControlReload;
- int mIdMediaBrowserControlClearCache;
- int mIdMediaBrowserControlClearCookies;
- int mIdMediaBrowserControlEnableCookies;
- int mMediaBrowserControlEnableCookies;
GLUI* mBottomGLUIWindow;
GLUI_StaticText* mStatusText;
diff --git a/indra/test_apps/llplugintest/CMakeLists.txt b/indra/test_apps/llplugintest/CMakeLists.txt
index 9d44563e26..0c8bdc464d 100755
--- a/indra/test_apps/llplugintest/CMakeLists.txt
+++ b/indra/test_apps/llplugintest/CMakeLists.txt
@@ -334,40 +334,40 @@ else (DARWIN)
)
endif (DARWIN)
-get_target_property(BUILT_SLPLUGIN SLPlugin LOCATION)
+set(BUILT_SLPLUGIN $<TARGET_FILE:SLPlugin>)
add_custom_command(TARGET llmediaplugintest POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_SLPLUGIN} ${PLUGINS_DESTINATION_DIR}
DEPENDS ${BUILT_SLPLUGIN}
)
-get_target_property(BUILT_LLCOMMON llcommon LOCATION)
+set(BUILT_LLCOMMON $<TARGET_FILE:llcommon>)
add_custom_command(TARGET llmediaplugintest POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_LLCOMMON} ${PLUGINS_DESTINATION_DIR}
DEPENDS ${BUILT_LLCOMMON}
)
-get_target_property(BUILT_WEBKIT_PLUGIN media_plugin_webkit LOCATION)
+set(BUILT_WEBKIT_PLUGIN $<TARGET_FILE:media_plugin_webkit>)
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_QUICKTIME_PLUGIN media_plugin_quicktime LOCATION)
+ set(BUILT_QUICKTIME_PLUGIN $<TARGET_FILE:media_plugin_quicktime>)
add_custom_command(TARGET llmediaplugintest POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_QUICKTIME_PLUGIN} ${PLUGINS_DESTINATION_DIR}
DEPENDS ${BUILT_QUICKTIME_PLUGIN}
)
endif (DARWIN OR WINDOWS)
-get_target_property(BUILT_EXAMPLE_PLUGIN media_plugin_example LOCATION)
+set(BUILT_EXAMPLE_PLUGIN $<TARGET_FILE:media_plugin_example>)
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)
+set(BUILT_LLMEDIAPLUGINTEST $<TARGET_FILE:llmediaplugintest>)
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}
diff --git a/indra/tools/vstool/VSTool.exe b/indra/tools/vstool/VSTool.exe
index 8be428614e..854290b90a 100755
--- a/indra/tools/vstool/VSTool.exe
+++ b/indra/tools/vstool/VSTool.exe
Binary files differ
diff --git a/indra/tools/vstool/main.cs b/indra/tools/vstool/main.cs
index cc73261e30..ef2e582b90 100755
--- a/indra/tools/vstool/main.cs
+++ b/indra/tools/vstool/main.cs
@@ -555,6 +555,10 @@ namespace VSTool
version = "VC100";
break;
+ case "12.00":
+ version = "VC120";
+ break;
+
default:
throw new ApplicationException("Unknown .sln version: " + format);
}
@@ -595,6 +599,10 @@ namespace VSTool
progid = "VisualStudio.DTE.10.0";
break;
+ case "VC120":
+ progid = "VisualStudio.DTE.12.0";
+ break;
+
default:
throw new ApplicationException("Can't handle VS version: " + version);
}
diff --git a/indra/viewer_components/login/CMakeLists.txt b/indra/viewer_components/login/CMakeLists.txt
index ce80d55829..c152f7c0a6 100755
--- a/indra/viewer_components/login/CMakeLists.txt
+++ b/indra/viewer_components/login/CMakeLists.txt
@@ -46,6 +46,7 @@ target_link_libraries(lllogin
${LLMATH_LIBRARIES}
${LLXML_LIBRARIES}
${BOOST_CONTEXT_LIBRARY}
+ ${BOOST_THREAD_LIBRARY}
${BOOST_COROUTINE_LIBRARY}
${BOOST_SYSTEM_LIBRARY}
)
@@ -57,7 +58,7 @@ if(LL_TESTS)
set_source_files_properties(
lllogin.cpp
PROPERTIES
- LL_TEST_ADDITIONAL_LIBRARIES "${BOOST_CONTEXT_LIBRARY};${BOOST_COROUTINE_LIBRARY};${BOOST_SYSTEM_LIBRARY}"
+ LL_TEST_ADDITIONAL_LIBRARIES "${BOOST_COROUTINE_LIBRARY};${BOOST_CONTEXT_LIBRARY};${BOOST_THREAD_LIBRARY};${BOOST_SYSTEM_LIBRARY}"
)
LL_ADD_PROJECT_UNIT_TESTS(lllogin "${lllogin_TEST_SOURCE_FILES}")