summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/doxygen/CMakeLists.txt6
-rw-r--r--indra/llappearance/llpolymorph.cpp8
-rw-r--r--indra/llcharacter/llcharacter.h2
-rw-r--r--indra/llcommon/indra_constants.h410
-rw-r--r--indra/llcommon/lldefs.h14
-rw-r--r--indra/llcommon/llprocessor.cpp3
-rw-r--r--indra/llcommon/stdtypes.h6
-rw-r--r--indra/llcommon/threadpool.h4
-rw-r--r--indra/llcommon/workqueue.cpp15
-rw-r--r--indra/llcommon/workqueue.h6
-rw-r--r--indra/llinventory/llinventory.cpp123
-rw-r--r--indra/llinventory/llinventory.h3
-rw-r--r--indra/llinventory/llparcel.h3
-rw-r--r--indra/llmath/llcamera.h26
-rw-r--r--indra/llmath/llcoordframe.cpp27
-rw-r--r--indra/llmath/llcoordframe.h2
-rw-r--r--indra/llmath/llline.h2
-rw-r--r--indra/llmath/llmath.h83
-rw-r--r--indra/llmath/llquaternion.cpp5
-rw-r--r--indra/llmath/llvolume.cpp25
-rw-r--r--indra/llmath/llvolume.h1
-rw-r--r--indra/llmath/m3math.cpp1
-rw-r--r--indra/llmath/m4math.cpp1
-rw-r--r--indra/llmath/v2math.cpp44
-rw-r--r--indra/llmath/v2math.h202
-rw-r--r--indra/llmath/v3color.cpp122
-rw-r--r--indra/llmath/v3color.h425
-rw-r--r--indra/llmath/v3colorutil.h68
-rw-r--r--indra/llmath/v3dmath.cpp45
-rw-r--r--indra/llmath/v3dmath.h378
-rw-r--r--indra/llmath/v3math.cpp137
-rw-r--r--indra/llmath/v3math.h305
-rw-r--r--indra/llmath/v4color.cpp391
-rw-r--r--indra/llmath/v4color.h706
-rw-r--r--indra/llmath/v4coloru.cpp65
-rw-r--r--indra/llmath/v4coloru.h371
-rw-r--r--indra/llmath/v4math.cpp19
-rw-r--r--indra/llmath/v4math.h415
-rw-r--r--indra/llmath/xform.h2
-rw-r--r--indra/llmessage/message_prehash.cpp1
-rw-r--r--indra/llmessage/message_prehash.h1
-rw-r--r--indra/llprimitive/llmodel.cpp7
-rw-r--r--indra/llprimitive/object_flags.h12
-rw-r--r--indra/llui/llaccordionctrltab.h6
-rw-r--r--indra/llui/llchatentry.cpp16
-rw-r--r--indra/llui/llchatentry.h2
-rw-r--r--indra/llui/llcheckboxctrl.h8
-rw-r--r--indra/llui/llcontainerview.h18
-rw-r--r--indra/llui/lldockablefloater.h4
-rw-r--r--indra/llui/lldockcontrol.cpp2
-rw-r--r--indra/llui/lldockcontrol.h8
-rw-r--r--indra/llui/lldraghandle.h2
-rw-r--r--indra/llui/llfiltereditor.h2
-rw-r--r--indra/llui/llflashtimer.cpp4
-rw-r--r--indra/llui/llflashtimer.h4
-rw-r--r--indra/llui/llflatlistview.cpp13
-rw-r--r--indra/llui/llflatlistview.h42
-rw-r--r--indra/llui/llfloater.cpp2
-rw-r--r--indra/llui/llfloater.h45
-rw-r--r--indra/llui/llfloaterreglistener.h1
-rw-r--r--indra/llui/llflyoutbutton.h2
-rw-r--r--indra/llui/llfocusmgr.h2
-rw-r--r--indra/llui/llfolderview.h31
-rw-r--r--indra/llui/llfolderviewitem.cpp249
-rw-r--r--indra/llui/llfolderviewitem.h35
-rw-r--r--indra/llui/llfolderviewmodel.h7
-rw-r--r--indra/llui/llkeywords.cpp2
-rw-r--r--indra/llui/llkeywords.h4
-rw-r--r--indra/llui/lllayoutstack.cpp4
-rw-r--r--indra/llui/lllayoutstack.h6
-rw-r--r--indra/llui/lllineeditor.h6
-rw-r--r--indra/llui/llmenubutton.h4
-rw-r--r--indra/llui/llmenugl.cpp2
-rw-r--r--indra/llui/llmenugl.h2
-rw-r--r--indra/llui/llmodaldialog.cpp12
-rw-r--r--indra/llui/llmultifloater.cpp2
-rw-r--r--indra/llui/llmultifloater.h2
-rw-r--r--indra/llui/llmultislider.h8
-rw-r--r--indra/llui/llmultisliderctrl.h9
-rw-r--r--indra/llui/llnotifications.h7
-rw-r--r--indra/llui/llprogressbar.h4
-rw-r--r--indra/llui/llresizebar.h2
-rw-r--r--indra/llui/llresizehandle.h12
-rw-r--r--indra/llui/llrngwriter.h2
-rw-r--r--indra/llui/llscrolllistcell.h2
-rw-r--r--indra/llui/llscrolllistctrl.h9
-rw-r--r--indra/llui/llsliderctrl.h1
-rw-r--r--indra/llui/llspinctrl.h1
-rw-r--r--indra/llui/llstatbar.h2
-rw-r--r--indra/llui/llstatgraph.cpp1
-rw-r--r--indra/llui/llstatgraph.h7
-rw-r--r--indra/llui/llstatview.h1
-rw-r--r--indra/llui/lltabcontainer.cpp10
-rw-r--r--indra/llui/lltabcontainer.h12
-rw-r--r--indra/llui/lltextbase.h18
-rw-r--r--indra/llui/lltextbox.h34
-rw-r--r--indra/llui/lltexteditor.cpp30
-rw-r--r--indra/llui/lltexteditor.h10
-rw-r--r--indra/llui/lltoolbar.h4
-rw-r--r--indra/llui/lltooltip.cpp8
-rw-r--r--indra/llui/lltooltip.h30
-rw-r--r--indra/llui/llui.h12
-rw-r--r--indra/llui/lluiconstants.h20
-rw-r--r--indra/llui/lluictrl.h6
-rw-r--r--indra/llui/lluictrlfactory.h2
-rw-r--r--indra/llui/llundo.h6
-rw-r--r--indra/llui/llurlaction.h2
-rw-r--r--indra/llui/llurlmatch.h1
-rw-r--r--indra/llui/llurlregistry.h1
-rw-r--r--indra/llui/llview.h22
-rw-r--r--indra/llui/llviewborder.h1
-rw-r--r--indra/llui/llviewereventrecorder.h2
-rw-r--r--indra/llui/llvirtualtrackball.h23
-rw-r--r--indra/llui/llwindowshade.h2
-rw-r--r--indra/llui/llxyvector.h18
-rw-r--r--indra/llwindow/llwindowwin32.cpp186
-rw-r--r--indra/newview/CMakeLists.txt2
-rw-r--r--indra/newview/app_settings/settings.xml83
-rw-r--r--indra/newview/app_settings/settings_per_account.xml2
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/tonemapUtilF.glsl37
-rw-r--r--indra/newview/gltfscenemanager.cpp3
-rw-r--r--indra/newview/llagent.cpp79
-rw-r--r--indra/newview/llagentcamera.cpp18
-rw-r--r--indra/newview/llagentcamera.h9
-rw-r--r--indra/newview/llagentpilot.cpp4
-rw-r--r--indra/newview/llaisapi.cpp2
-rw-r--r--indra/newview/llappearancemgr.cpp11
-rw-r--r--indra/newview/llappearancemgr.h2
-rw-r--r--indra/newview/llappviewer.cpp81
-rw-r--r--indra/newview/llautoreplace.cpp5
-rw-r--r--indra/newview/llcontrolavatar.cpp16
-rw-r--r--indra/newview/llconversationlog.cpp2
-rw-r--r--indra/newview/llconversationmodel.h3
-rw-r--r--indra/newview/llfloaterautoreplacesettings.cpp51
-rw-r--r--indra/newview/llfloaterautoreplacesettings.h2
-rw-r--r--indra/newview/llfloaterbvhpreview.cpp7
-rw-r--r--indra/newview/llfloaterbvhpreview.h2
-rw-r--r--indra/newview/llfloatereditenvironmentbase.h3
-rw-r--r--indra/newview/llfloaterenvironmentadjust.cpp24
-rw-r--r--indra/newview/llfloaterimagepreview.cpp4
-rw-r--r--indra/newview/llfloaterimagepreview.h2
-rw-r--r--indra/newview/llfloaterinventorysettings.cpp28
-rw-r--r--indra/newview/llfloaterinventorysettings.h5
-rw-r--r--indra/newview/llfloatermodelpreview.cpp16
-rw-r--r--indra/newview/llfloatermodelpreview.h7
-rw-r--r--indra/newview/llfloatermyenvironment.cpp89
-rw-r--r--indra/newview/llfloatermyenvironment.h3
-rw-r--r--indra/newview/llfloaternamedesc.cpp32
-rw-r--r--indra/newview/llfloaternamedesc.h3
-rw-r--r--indra/newview/llfloaterobjectweights.cpp96
-rw-r--r--indra/newview/llfloaterobjectweights.h19
-rw-r--r--indra/newview/llfloaterpreference.cpp14
-rwxr-xr-xindra/newview/llfloaterworldmap.cpp7
-rw-r--r--indra/newview/llfolderviewmodelinventory.cpp30
-rw-r--r--indra/newview/llfolderviewmodelinventory.h1
-rw-r--r--indra/newview/llgltffolderitem.h5
-rw-r--r--indra/newview/llhudeffectresetskeleton.cpp211
-rw-r--r--indra/newview/llhudeffectresetskeleton.h59
-rw-r--r--indra/newview/llhudobject.cpp4
-rw-r--r--indra/newview/llhudobject.h3
-rw-r--r--indra/newview/llimprocessing.cpp49
-rw-r--r--indra/newview/llimprocessing.h1
-rw-r--r--indra/newview/llimview.cpp15
-rw-r--r--indra/newview/llimview.h4
-rw-r--r--indra/newview/llinspecttexture.cpp13
-rw-r--r--indra/newview/llinventorybridge.cpp125
-rw-r--r--indra/newview/llinventorybridge.h45
-rw-r--r--indra/newview/llinventoryfilter.cpp79
-rw-r--r--indra/newview/llinventoryfilter.h15
-rw-r--r--indra/newview/llinventoryfunctions.cpp244
-rw-r--r--indra/newview/llinventoryfunctions.h18
-rw-r--r--indra/newview/llinventorygallery.cpp35
-rw-r--r--indra/newview/llinventorygallery.h5
-rw-r--r--indra/newview/llinventorygallerymenu.cpp65
-rw-r--r--indra/newview/llinventoryitemslist.cpp2
-rw-r--r--indra/newview/llinventorylistitem.cpp56
-rw-r--r--indra/newview/llinventorylistitem.h6
-rw-r--r--indra/newview/llinventorymodel.cpp5
-rw-r--r--indra/newview/llinventoryobserver.cpp29
-rw-r--r--indra/newview/llinventoryobserver.h19
-rw-r--r--indra/newview/llinventorypanel.cpp387
-rw-r--r--indra/newview/llinventorypanel.h9
-rw-r--r--indra/newview/llmaterialeditor.cpp28
-rw-r--r--indra/newview/llmaterialeditor.h14
-rw-r--r--indra/newview/llmeshrepository.cpp57
-rw-r--r--indra/newview/llmeshrepository.h12
-rw-r--r--indra/newview/llmodelpreview.cpp3
-rw-r--r--indra/newview/lloutfitgallery.cpp208
-rw-r--r--indra/newview/lloutfitgallery.h36
-rw-r--r--indra/newview/lloutfitslist.cpp332
-rw-r--r--indra/newview/lloutfitslist.h64
-rw-r--r--indra/newview/llpanelappearancetab.h7
-rw-r--r--indra/newview/llpanelface.cpp8
-rw-r--r--indra/newview/llpanelgroupcreate.cpp1
-rw-r--r--indra/newview/llpanelgroupgeneral.cpp1
-rw-r--r--indra/newview/llpanelmaininventory.cpp15
-rw-r--r--indra/newview/llpanelobjectinventory.cpp19
-rw-r--r--indra/newview/llpaneloutfitedit.cpp4
-rw-r--r--indra/newview/llpaneloutfitsinventory.cpp67
-rw-r--r--indra/newview/llpaneloutfitsinventory.h22
-rw-r--r--indra/newview/llpanelpeoplemenus.cpp5
-rw-r--r--indra/newview/llpanelpermissions.cpp16
-rw-r--r--indra/newview/llpanelpermissions.h1
-rw-r--r--indra/newview/llpanelprimmediacontrols.cpp2
-rw-r--r--indra/newview/llpanelprofile.cpp1
-rw-r--r--indra/newview/llpanelprofileclassifieds.h16
-rw-r--r--indra/newview/llpanelsnapshot.cpp12
-rw-r--r--indra/newview/llpanelsnapshotinventory.cpp128
-rw-r--r--indra/newview/llpanelsnapshotlocal.cpp20
-rw-r--r--indra/newview/llpanelsnapshotoptions.cpp37
-rw-r--r--indra/newview/llpanelsnapshotpostcard.cpp20
-rw-r--r--indra/newview/llpanelsnapshotprofile.cpp18
-rw-r--r--indra/newview/llpanelwearing.cpp28
-rw-r--r--indra/newview/llpanelwearing.h6
-rw-r--r--indra/newview/llphysicsmotion.cpp21
-rw-r--r--indra/newview/llpreviewscript.cpp5
-rw-r--r--indra/newview/llpreviewscript.h5
-rw-r--r--indra/newview/llselectmgr.cpp1
-rw-r--r--indra/newview/llselectmgr.h1
-rw-r--r--indra/newview/llsidepanelappearance.cpp9
-rw-r--r--indra/newview/llsidepaneliteminfo.cpp21
-rw-r--r--indra/newview/llsidepaneliteminfo.h2
-rw-r--r--indra/newview/llskinningutil.cpp4
-rw-r--r--indra/newview/llsnapshotlivepreview.cpp2
-rw-r--r--indra/newview/llteleporthistorystorage.cpp6
-rw-r--r--indra/newview/lltexturectrl.cpp31
-rw-r--r--indra/newview/lltexturectrl.h3
-rw-r--r--indra/newview/lltexturefetch.cpp13
-rw-r--r--indra/newview/lltexturefetch.h3
-rw-r--r--indra/newview/llthumbnailctrl.cpp10
-rw-r--r--indra/newview/lltoast.cpp2
-rw-r--r--indra/newview/lltooldraganddrop.cpp4
-rw-r--r--indra/newview/llviewerassetupload.cpp25
-rw-r--r--indra/newview/llviewerassetupload.h5
-rw-r--r--indra/newview/llviewerattachmenu.cpp4
-rw-r--r--indra/newview/llviewercamera.cpp78
-rw-r--r--indra/newview/llviewercamera.h16
-rw-r--r--indra/newview/llviewerinventory.cpp7
-rw-r--r--indra/newview/llviewerinventory.h2
-rw-r--r--indra/newview/llviewerjoystick.cpp21
-rw-r--r--indra/newview/llviewermenu.cpp105
-rw-r--r--indra/newview/llviewermenufile.cpp33
-rw-r--r--indra/newview/llviewermenufile.h11
-rw-r--r--indra/newview/llviewermessage.cpp32
-rw-r--r--indra/newview/llviewerobject.cpp6
-rw-r--r--indra/newview/llviewerparcelmgr.cpp12
-rw-r--r--indra/newview/llviewerparcelmgr.h2
-rw-r--r--indra/newview/llviewertexture.cpp39
-rw-r--r--indra/newview/llviewertexture.h1
-rw-r--r--indra/newview/llviewerwindow.cpp24
-rw-r--r--indra/newview/llvoavatar.cpp143
-rw-r--r--indra/newview/llvoavatar.h18
-rw-r--r--indra/newview/llvoicecallhandler.cpp5
-rw-r--r--indra/newview/llvoicechannel.cpp6
-rw-r--r--indra/newview/llvovolume.cpp7
-rw-r--r--indra/newview/llwearableitemslist.cpp23
-rw-r--r--indra/newview/llwearableitemslist.h2
-rw-r--r--indra/newview/pipeline.cpp10
-rw-r--r--indra/newview/skins/default/colors.xml3
-rw-r--r--indra/newview/skins/default/textures/icons/Icon_Pointer.pngbin0 -> 294 bytes
-rw-r--r--indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Content.pngbin0 -> 620 bytes
-rw-r--r--indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Full.pngbin0 -> 485 bytes
-rw-r--r--indra/newview/skins/default/textures/textures.xml35
-rw-r--r--indra/newview/skins/default/xui/da/strings.xml4
-rw-r--r--indra/newview/skins/default/xui/de/panel_snapshot_inventory.xml2
-rw-r--r--indra/newview/skins/default/xui/de/panel_snapshot_options.xml2
-rw-r--r--indra/newview/skins/default/xui/de/strings.xml4
-rw-r--r--indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml421
-rw-r--r--indra/newview/skins/default/xui/en/floater_inventory_settings.xml181
-rw-r--r--indra/newview/skins/default/xui/en/floater_my_inventory.xml2
-rw-r--r--indra/newview/skins/default/xui/en/floater_new_feature_notification.xml12
-rw-r--r--indra/newview/skins/default/xui/en/floater_object_weights.xml110
-rw-r--r--indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml6
-rw-r--r--indra/newview/skins/default/xui/en/floater_preview_trash.xml2
-rw-r--r--indra/newview/skins/default/xui/en/floater_voice_chat_volume.xml2
-rw-r--r--indra/newview/skins/default/xui/en/menu_gallery_inventory.xml146
-rwxr-xr-xindra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml20
-rw-r--r--indra/newview/skins/default/xui/en/menu_inventory.xml121
-rw-r--r--indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml11
-rw-r--r--indra/newview/skins/default/xui/en/menu_inventory_view_default.xml11
-rw-r--r--indra/newview/skins/default/xui/en/menu_outfit_gallery_sort.xml42
-rw-r--r--indra/newview/skins/default/xui/en/menu_outfit_gear.xml63
-rw-r--r--indra/newview/skins/default/xui/en/menu_outfit_list_sort.xml49
-rw-r--r--indra/newview/skins/default/xui/en/menu_outfit_tab.xml20
-rw-r--r--indra/newview/skins/default/xui/en/menu_settings_gear.xml3
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml58
-rw-r--r--indra/newview/skins/default/xui/en/menu_wearable_list_item.xml14
-rw-r--r--indra/newview/skins/default/xui/en/menu_wearing_tab.xml14
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml44
-rw-r--r--indra/newview/skins/default/xui/en/panel_inventory_gallery_item.xml10
-rw-r--r--indra/newview/skins/default/xui/en/panel_main_inventory.xml16
-rw-r--r--indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml2
-rw-r--r--indra/newview/skins/default/xui/en/panel_marketplace_listings_listed.xml2
-rw-r--r--indra/newview/skins/default/xui/en/panel_marketplace_listings_unassociated.xml2
-rw-r--r--indra/newview/skins/default/xui/en/panel_marketplace_listings_unlisted.xml2
-rw-r--r--indra/newview/skins/default/xui/en/panel_outfit_gallery.xml48
-rw-r--r--indra/newview/skins/default/xui/en/panel_outfits_list.xml46
-rw-r--r--indra/newview/skins/default/xui/en/panel_outfits_wearing.xml33
-rw-r--r--indra/newview/skins/default/xui/en/panel_places.xml2
-rw-r--r--indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml35
-rw-r--r--indra/newview/skins/default/xui/en/panel_preferences_move.xml2
-rw-r--r--indra/newview/skins/default/xui/en/panel_settings_sky_clouds.xml2
-rw-r--r--indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml24
-rw-r--r--indra/newview/skins/default/xui/en/panel_settings_water.xml6
-rw-r--r--indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml4
-rw-r--r--indra/newview/skins/default/xui/en/panel_snapshot_options.xml2
-rw-r--r--indra/newview/skins/default/xui/en/sidepanel_appearance.xml111
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml57
-rw-r--r--indra/newview/skins/default/xui/en/widgets/folder_view_item.xml2
-rw-r--r--indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml2
-rw-r--r--indra/newview/skins/default/xui/en/widgets/sun_moon_trackball.xml1
-rw-r--r--indra/newview/skins/default/xui/en/widgets/xy_vector.xml4
-rw-r--r--indra/newview/skins/default/xui/es/panel_snapshot_inventory.xml2
-rw-r--r--indra/newview/skins/default/xui/es/panel_snapshot_options.xml2
-rw-r--r--indra/newview/skins/default/xui/es/strings.xml4
-rw-r--r--indra/newview/skins/default/xui/fr/panel_snapshot_inventory.xml2
-rw-r--r--indra/newview/skins/default/xui/fr/panel_snapshot_options.xml2
-rw-r--r--indra/newview/skins/default/xui/fr/strings.xml4
-rw-r--r--indra/newview/skins/default/xui/it/panel_snapshot_inventory.xml2
-rw-r--r--indra/newview/skins/default/xui/it/panel_snapshot_options.xml2
-rw-r--r--indra/newview/skins/default/xui/it/strings.xml4
-rw-r--r--indra/newview/skins/default/xui/ja/panel_settings_sky_sunmoon.xml4
-rw-r--r--indra/newview/skins/default/xui/ja/panel_snapshot_inventory.xml4
-rw-r--r--indra/newview/skins/default/xui/ja/panel_snapshot_options.xml2
-rw-r--r--indra/newview/skins/default/xui/ja/strings.xml4
-rw-r--r--indra/newview/skins/default/xui/pl/panel_settings_sky_sunmoon.xml4
-rw-r--r--indra/newview/skins/default/xui/pl/panel_snapshot_options.xml2
-rw-r--r--indra/newview/skins/default/xui/pl/strings.xml4
-rw-r--r--indra/newview/skins/default/xui/pt/panel_snapshot_inventory.xml2
-rw-r--r--indra/newview/skins/default/xui/pt/panel_snapshot_options.xml2
-rw-r--r--indra/newview/skins/default/xui/pt/strings.xml4
-rw-r--r--indra/newview/skins/default/xui/ru/panel_snapshot_inventory.xml2
-rw-r--r--indra/newview/skins/default/xui/ru/panel_snapshot_options.xml2
-rw-r--r--indra/newview/skins/default/xui/ru/strings.xml4
-rw-r--r--indra/newview/skins/default/xui/tr/panel_snapshot_inventory.xml2
-rw-r--r--indra/newview/skins/default/xui/tr/panel_snapshot_options.xml2
-rw-r--r--indra/newview/skins/default/xui/tr/strings.xml4
-rw-r--r--indra/newview/skins/default/xui/zh/panel_snapshot_inventory.xml2
-rw-r--r--indra/newview/skins/default/xui/zh/panel_snapshot_options.xml2
-rw-r--r--indra/newview/skins/default/xui/zh/strings.xml4
-rw-r--r--indra/test/llhttpdate_tut.cpp7
341 files changed, 7356 insertions, 4419 deletions
diff --git a/indra/doxygen/CMakeLists.txt b/indra/doxygen/CMakeLists.txt
index 616b5cd09c..354ae7b636 100644
--- a/indra/doxygen/CMakeLists.txt
+++ b/indra/doxygen/CMakeLists.txt
@@ -1,11 +1,5 @@
# -*- cmake -*-
-# cmake_minimum_required should appear before any
-# other commands to guarantee full compatibility
-# with the version specified
-## prior to 2.8, the add_custom_target commands used in setting the version did not work correctly
-cmake_minimum_required(VERSION 3.8.0 FATAL_ERROR)
-
set(ROOT_PROJECT_NAME "SecondLife" CACHE STRING
"The root project/makefile/solution name. Defaults to SecondLife.")
project(${ROOT_PROJECT_NAME})
diff --git a/indra/llappearance/llpolymorph.cpp b/indra/llappearance/llpolymorph.cpp
index 8df8a9726f..5ee6649164 100644
--- a/indra/llappearance/llpolymorph.cpp
+++ b/indra/llappearance/llpolymorph.cpp
@@ -550,12 +550,12 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
mLastSex = avatar_sex;
- // Check for NaN condition (NaN is detected if a variable doesn't equal itself.
- if (mCurWeight != mCurWeight)
+ // Check for NaN condition
+ if (llisnan(mCurWeight))
{
- mCurWeight = 0.0;
+ mCurWeight = 0.f;
}
- if (mLastWeight != mLastWeight)
+ if (llisnan(mLastWeight))
{
mLastWeight = mCurWeight+.001f;
}
diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h
index 6143ec8cd1..0b9b148463 100644
--- a/indra/llcharacter/llcharacter.h
+++ b/indra/llcharacter/llcharacter.h
@@ -119,6 +119,8 @@ public:
virtual void addDebugText( const std::string& text ) = 0;
+ virtual std::string getDebugName() const { return getID().asString(); }
+
virtual const LLUUID& getID() const = 0;
//-------------------------------------------------------------------------
// End Interface
diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h
index d2de88ff0a..a0394da281 100644
--- a/indra/llcommon/indra_constants.h
+++ b/indra/llcommon/indra_constants.h
@@ -31,15 +31,15 @@
class LLUUID;
-static const F32 REGION_WIDTH_METERS = 256.f;
-static const S32 REGION_WIDTH_UNITS = 256;
-static const U32 REGION_WIDTH_U32 = 256;
+static constexpr F32 REGION_WIDTH_METERS = 256.f;
+static constexpr S32 REGION_WIDTH_UNITS = 256;
+static constexpr U32 REGION_WIDTH_U32 = 256;
-const F32 REGION_HEIGHT_METERS = 4096.f;
+constexpr F32 REGION_HEIGHT_METERS = 4096.f;
-const F32 DEFAULT_AGENT_DEPTH = 0.45f;
-const F32 DEFAULT_AGENT_WIDTH = 0.60f;
-const F32 DEFAULT_AGENT_HEIGHT = 1.9f;
+constexpr F32 DEFAULT_AGENT_DEPTH = 0.45f;
+constexpr F32 DEFAULT_AGENT_WIDTH = 0.60f;
+constexpr F32 DEFAULT_AGENT_HEIGHT = 1.9f;
enum ETerrainBrushType
{
@@ -67,112 +67,112 @@ enum EMouseClickType{
// keys
// Bit masks for various keyboard modifier keys.
-const MASK MASK_NONE = 0x0000;
-const MASK MASK_CONTROL = 0x0001; // Mapped to cmd on Macs
-const MASK MASK_ALT = 0x0002;
-const MASK MASK_SHIFT = 0x0004;
-const MASK MASK_NORMALKEYS = 0x0007; // A real mask - only get the bits for normal modifier keys
-const MASK MASK_MAC_CONTROL = 0x0008; // Un-mapped Ctrl key on Macs, not used on Windows
-const MASK MASK_MODIFIERS = MASK_CONTROL|MASK_ALT|MASK_SHIFT|MASK_MAC_CONTROL;
+constexpr MASK MASK_NONE = 0x0000;
+constexpr MASK MASK_CONTROL = 0x0001; // Mapped to cmd on Macs
+constexpr MASK MASK_ALT = 0x0002;
+constexpr MASK MASK_SHIFT = 0x0004;
+constexpr MASK MASK_NORMALKEYS = 0x0007; // A real mask - only get the bits for normal modifier keys
+constexpr MASK MASK_MAC_CONTROL = 0x0008; // Un-mapped Ctrl key on Macs, not used on Windows
+constexpr MASK MASK_MODIFIERS = MASK_CONTROL|MASK_ALT|MASK_SHIFT|MASK_MAC_CONTROL;
// Special keys go into >128
-const KEY KEY_SPECIAL = 0x80; // special keys start here
-const KEY KEY_RETURN = 0x81;
-const KEY KEY_LEFT = 0x82;
-const KEY KEY_RIGHT = 0x83;
-const KEY KEY_UP = 0x84;
-const KEY KEY_DOWN = 0x85;
-const KEY KEY_ESCAPE = 0x86;
-const KEY KEY_BACKSPACE =0x87;
-const KEY KEY_DELETE = 0x88;
-const KEY KEY_SHIFT = 0x89;
-const KEY KEY_CONTROL = 0x8A;
-const KEY KEY_ALT = 0x8B;
-const KEY KEY_HOME = 0x8C;
-const KEY KEY_END = 0x8D;
-const KEY KEY_PAGE_UP = 0x8E;
-const KEY KEY_PAGE_DOWN = 0x8F;
-const KEY KEY_HYPHEN = 0x90;
-const KEY KEY_EQUALS = 0x91;
-const KEY KEY_INSERT = 0x92;
-const KEY KEY_CAPSLOCK = 0x93;
-const KEY KEY_TAB = 0x94;
-const KEY KEY_ADD = 0x95;
-const KEY KEY_SUBTRACT =0x96;
-const KEY KEY_MULTIPLY =0x97;
-const KEY KEY_DIVIDE = 0x98;
-const KEY KEY_F1 = 0xA1;
-const KEY KEY_F2 = 0xA2;
-const KEY KEY_F3 = 0xA3;
-const KEY KEY_F4 = 0xA4;
-const KEY KEY_F5 = 0xA5;
-const KEY KEY_F6 = 0xA6;
-const KEY KEY_F7 = 0xA7;
-const KEY KEY_F8 = 0xA8;
-const KEY KEY_F9 = 0xA9;
-const KEY KEY_F10 = 0xAA;
-const KEY KEY_F11 = 0xAB;
-const KEY KEY_F12 = 0xAC;
-
-const KEY KEY_PAD_UP = 0xC0;
-const KEY KEY_PAD_DOWN = 0xC1;
-const KEY KEY_PAD_LEFT = 0xC2;
-const KEY KEY_PAD_RIGHT = 0xC3;
-const KEY KEY_PAD_HOME = 0xC4;
-const KEY KEY_PAD_END = 0xC5;
-const KEY KEY_PAD_PGUP = 0xC6;
-const KEY KEY_PAD_PGDN = 0xC7;
-const KEY KEY_PAD_CENTER = 0xC8; // the 5 in the middle
-const KEY KEY_PAD_INS = 0xC9;
-const KEY KEY_PAD_DEL = 0xCA;
-const KEY KEY_PAD_RETURN = 0xCB;
-const KEY KEY_PAD_ADD = 0xCC; // not used
-const KEY KEY_PAD_SUBTRACT = 0xCD; // not used
-const KEY KEY_PAD_MULTIPLY = 0xCE; // not used
-const KEY KEY_PAD_DIVIDE = 0xCF; // not used
-
-const KEY KEY_BUTTON0 = 0xD0;
-const KEY KEY_BUTTON1 = 0xD1;
-const KEY KEY_BUTTON2 = 0xD2;
-const KEY KEY_BUTTON3 = 0xD3;
-const KEY KEY_BUTTON4 = 0xD4;
-const KEY KEY_BUTTON5 = 0xD5;
-const KEY KEY_BUTTON6 = 0xD6;
-const KEY KEY_BUTTON7 = 0xD7;
-const KEY KEY_BUTTON8 = 0xD8;
-const KEY KEY_BUTTON9 = 0xD9;
-const KEY KEY_BUTTON10 = 0xDA;
-const KEY KEY_BUTTON11 = 0xDB;
-const KEY KEY_BUTTON12 = 0xDC;
-const KEY KEY_BUTTON13 = 0xDD;
-const KEY KEY_BUTTON14 = 0xDE;
-const KEY KEY_BUTTON15 = 0xDF;
-
-const KEY KEY_NONE = 0xFF; // not sent from keyboard. For internal use only.
-
-const S32 KEY_COUNT = 256;
-
-
-const F32 DEFAULT_WATER_HEIGHT = 20.0f;
+constexpr KEY KEY_SPECIAL = 0x80; // special keys start here
+constexpr KEY KEY_RETURN = 0x81;
+constexpr KEY KEY_LEFT = 0x82;
+constexpr KEY KEY_RIGHT = 0x83;
+constexpr KEY KEY_UP = 0x84;
+constexpr KEY KEY_DOWN = 0x85;
+constexpr KEY KEY_ESCAPE = 0x86;
+constexpr KEY KEY_BACKSPACE =0x87;
+constexpr KEY KEY_DELETE = 0x88;
+constexpr KEY KEY_SHIFT = 0x89;
+constexpr KEY KEY_CONTROL = 0x8A;
+constexpr KEY KEY_ALT = 0x8B;
+constexpr KEY KEY_HOME = 0x8C;
+constexpr KEY KEY_END = 0x8D;
+constexpr KEY KEY_PAGE_UP = 0x8E;
+constexpr KEY KEY_PAGE_DOWN = 0x8F;
+constexpr KEY KEY_HYPHEN = 0x90;
+constexpr KEY KEY_EQUALS = 0x91;
+constexpr KEY KEY_INSERT = 0x92;
+constexpr KEY KEY_CAPSLOCK = 0x93;
+constexpr KEY KEY_TAB = 0x94;
+constexpr KEY KEY_ADD = 0x95;
+constexpr KEY KEY_SUBTRACT =0x96;
+constexpr KEY KEY_MULTIPLY =0x97;
+constexpr KEY KEY_DIVIDE = 0x98;
+constexpr KEY KEY_F1 = 0xA1;
+constexpr KEY KEY_F2 = 0xA2;
+constexpr KEY KEY_F3 = 0xA3;
+constexpr KEY KEY_F4 = 0xA4;
+constexpr KEY KEY_F5 = 0xA5;
+constexpr KEY KEY_F6 = 0xA6;
+constexpr KEY KEY_F7 = 0xA7;
+constexpr KEY KEY_F8 = 0xA8;
+constexpr KEY KEY_F9 = 0xA9;
+constexpr KEY KEY_F10 = 0xAA;
+constexpr KEY KEY_F11 = 0xAB;
+constexpr KEY KEY_F12 = 0xAC;
+
+constexpr KEY KEY_PAD_UP = 0xC0;
+constexpr KEY KEY_PAD_DOWN = 0xC1;
+constexpr KEY KEY_PAD_LEFT = 0xC2;
+constexpr KEY KEY_PAD_RIGHT = 0xC3;
+constexpr KEY KEY_PAD_HOME = 0xC4;
+constexpr KEY KEY_PAD_END = 0xC5;
+constexpr KEY KEY_PAD_PGUP = 0xC6;
+constexpr KEY KEY_PAD_PGDN = 0xC7;
+constexpr KEY KEY_PAD_CENTER = 0xC8; // the 5 in the middle
+constexpr KEY KEY_PAD_INS = 0xC9;
+constexpr KEY KEY_PAD_DEL = 0xCA;
+constexpr KEY KEY_PAD_RETURN = 0xCB;
+constexpr KEY KEY_PAD_ADD = 0xCC; // not used
+constexpr KEY KEY_PAD_SUBTRACT = 0xCD; // not used
+constexpr KEY KEY_PAD_MULTIPLY = 0xCE; // not used
+constexpr KEY KEY_PAD_DIVIDE = 0xCF; // not used
+
+constexpr KEY KEY_BUTTON0 = 0xD0;
+constexpr KEY KEY_BUTTON1 = 0xD1;
+constexpr KEY KEY_BUTTON2 = 0xD2;
+constexpr KEY KEY_BUTTON3 = 0xD3;
+constexpr KEY KEY_BUTTON4 = 0xD4;
+constexpr KEY KEY_BUTTON5 = 0xD5;
+constexpr KEY KEY_BUTTON6 = 0xD6;
+constexpr KEY KEY_BUTTON7 = 0xD7;
+constexpr KEY KEY_BUTTON8 = 0xD8;
+constexpr KEY KEY_BUTTON9 = 0xD9;
+constexpr KEY KEY_BUTTON10 = 0xDA;
+constexpr KEY KEY_BUTTON11 = 0xDB;
+constexpr KEY KEY_BUTTON12 = 0xDC;
+constexpr KEY KEY_BUTTON13 = 0xDD;
+constexpr KEY KEY_BUTTON14 = 0xDE;
+constexpr KEY KEY_BUTTON15 = 0xDF;
+
+constexpr KEY KEY_NONE = 0xFF; // not sent from keyboard. For internal use only.
+
+constexpr S32 KEY_COUNT = 256;
+
+
+constexpr F32 DEFAULT_WATER_HEIGHT = 20.0f;
// Maturity ratings for simulators
-const U8 SIM_ACCESS_MIN = 0; // Treated as 'unknown', usually ends up being SIM_ACCESS_PG
-const U8 SIM_ACCESS_PG = 13;
-const U8 SIM_ACCESS_MATURE = 21;
-const U8 SIM_ACCESS_ADULT = 42; // Seriously Adult Only
-const U8 SIM_ACCESS_DOWN = 254;
-const U8 SIM_ACCESS_MAX = SIM_ACCESS_ADULT;
+constexpr U8 SIM_ACCESS_MIN = 0; // Treated as 'unknown', usually ends up being SIM_ACCESS_PG
+constexpr U8 SIM_ACCESS_PG = 13;
+constexpr U8 SIM_ACCESS_MATURE = 21;
+constexpr U8 SIM_ACCESS_ADULT = 42; // Seriously Adult Only
+constexpr U8 SIM_ACCESS_DOWN = 254;
+constexpr U8 SIM_ACCESS_MAX = SIM_ACCESS_ADULT;
// attachment constants
-const U8 ATTACHMENT_ADD = 0x80;
+constexpr U8 ATTACHMENT_ADD = 0x80;
// god levels
-const U8 GOD_MAINTENANCE = 250;
-const U8 GOD_FULL = 200;
-const U8 GOD_LIAISON = 150;
-const U8 GOD_CUSTOMER_SERVICE = 100;
-const U8 GOD_LIKE = 1;
-const U8 GOD_NOT = 0;
+constexpr U8 GOD_MAINTENANCE = 250;
+constexpr U8 GOD_FULL = 200;
+constexpr U8 GOD_LIAISON = 150;
+constexpr U8 GOD_CUSTOMER_SERVICE = 100;
+constexpr U8 GOD_LIKE = 1;
+constexpr U8 GOD_NOT = 0;
// "agent id" for things that should be done to ALL agents
LL_COMMON_API extern const LLUUID LL_UUID_ALL_AGENTS;
@@ -239,121 +239,123 @@ LL_COMMON_API extern const LLUUID BLANK_OBJECT_NORMAL;
LL_COMMON_API extern const LLUUID BLANK_MATERIAL_ASSET_ID;
// radius within which a chat message is fully audible
-const F32 CHAT_NORMAL_RADIUS = 20.f;
+constexpr F32 CHAT_NORMAL_RADIUS = 20.f;
// media commands
-const U32 PARCEL_MEDIA_COMMAND_STOP = 0;
-const U32 PARCEL_MEDIA_COMMAND_PAUSE = 1;
-const U32 PARCEL_MEDIA_COMMAND_PLAY = 2;
-const U32 PARCEL_MEDIA_COMMAND_LOOP = 3;
-const U32 PARCEL_MEDIA_COMMAND_TEXTURE = 4;
-const U32 PARCEL_MEDIA_COMMAND_URL = 5;
-const U32 PARCEL_MEDIA_COMMAND_TIME = 6;
-const U32 PARCEL_MEDIA_COMMAND_AGENT = 7;
-const U32 PARCEL_MEDIA_COMMAND_UNLOAD = 8;
-const U32 PARCEL_MEDIA_COMMAND_AUTO_ALIGN = 9;
-const U32 PARCEL_MEDIA_COMMAND_TYPE = 10;
-const U32 PARCEL_MEDIA_COMMAND_SIZE = 11;
-const U32 PARCEL_MEDIA_COMMAND_DESC = 12;
-const U32 PARCEL_MEDIA_COMMAND_LOOP_SET = 13;
+constexpr U32 PARCEL_MEDIA_COMMAND_STOP = 0;
+constexpr U32 PARCEL_MEDIA_COMMAND_PAUSE = 1;
+constexpr U32 PARCEL_MEDIA_COMMAND_PLAY = 2;
+constexpr U32 PARCEL_MEDIA_COMMAND_LOOP = 3;
+constexpr U32 PARCEL_MEDIA_COMMAND_TEXTURE = 4;
+constexpr U32 PARCEL_MEDIA_COMMAND_URL = 5;
+constexpr U32 PARCEL_MEDIA_COMMAND_TIME = 6;
+constexpr U32 PARCEL_MEDIA_COMMAND_AGENT = 7;
+constexpr U32 PARCEL_MEDIA_COMMAND_UNLOAD = 8;
+constexpr U32 PARCEL_MEDIA_COMMAND_AUTO_ALIGN = 9;
+constexpr U32 PARCEL_MEDIA_COMMAND_TYPE = 10;
+constexpr U32 PARCEL_MEDIA_COMMAND_SIZE = 11;
+constexpr U32 PARCEL_MEDIA_COMMAND_DESC = 12;
+constexpr U32 PARCEL_MEDIA_COMMAND_LOOP_SET = 13;
const S32 CHAT_CHANNEL_DEBUG = S32_MAX;
// agent constants
-const U32 CONTROL_AT_POS_INDEX = 0;
-const U32 CONTROL_AT_NEG_INDEX = 1;
-const U32 CONTROL_LEFT_POS_INDEX = 2;
-const U32 CONTROL_LEFT_NEG_INDEX = 3;
-const U32 CONTROL_UP_POS_INDEX = 4;
-const U32 CONTROL_UP_NEG_INDEX = 5;
-const U32 CONTROL_PITCH_POS_INDEX = 6;
-const U32 CONTROL_PITCH_NEG_INDEX = 7;
-const U32 CONTROL_YAW_POS_INDEX = 8;
-const U32 CONTROL_YAW_NEG_INDEX = 9;
-const U32 CONTROL_FAST_AT_INDEX = 10;
-const U32 CONTROL_FAST_LEFT_INDEX = 11;
-const U32 CONTROL_FAST_UP_INDEX = 12;
-const U32 CONTROL_FLY_INDEX = 13;
-const U32 CONTROL_STOP_INDEX = 14;
-const U32 CONTROL_FINISH_ANIM_INDEX = 15;
-const U32 CONTROL_STAND_UP_INDEX = 16;
-const U32 CONTROL_SIT_ON_GROUND_INDEX = 17;
-const U32 CONTROL_MOUSELOOK_INDEX = 18;
-const U32 CONTROL_NUDGE_AT_POS_INDEX = 19;
-const U32 CONTROL_NUDGE_AT_NEG_INDEX = 20;
-const U32 CONTROL_NUDGE_LEFT_POS_INDEX = 21;
-const U32 CONTROL_NUDGE_LEFT_NEG_INDEX = 22;
-const U32 CONTROL_NUDGE_UP_POS_INDEX = 23;
-const U32 CONTROL_NUDGE_UP_NEG_INDEX = 24;
-const U32 CONTROL_TURN_LEFT_INDEX = 25;
-const U32 CONTROL_TURN_RIGHT_INDEX = 26;
-const U32 CONTROL_AWAY_INDEX = 27;
-const U32 CONTROL_LBUTTON_DOWN_INDEX = 28;
-const U32 CONTROL_LBUTTON_UP_INDEX = 29;
-const U32 CONTROL_ML_LBUTTON_DOWN_INDEX = 30;
-const U32 CONTROL_ML_LBUTTON_UP_INDEX = 31;
-const U32 TOTAL_CONTROLS = 32;
-
-const U32 AGENT_CONTROL_AT_POS = 0x1 << CONTROL_AT_POS_INDEX; // 0x00000001
-const U32 AGENT_CONTROL_AT_NEG = 0x1 << CONTROL_AT_NEG_INDEX; // 0x00000002
-const U32 AGENT_CONTROL_LEFT_POS = 0x1 << CONTROL_LEFT_POS_INDEX; // 0x00000004
-const U32 AGENT_CONTROL_LEFT_NEG = 0x1 << CONTROL_LEFT_NEG_INDEX; // 0x00000008
-const U32 AGENT_CONTROL_UP_POS = 0x1 << CONTROL_UP_POS_INDEX; // 0x00000010
-const U32 AGENT_CONTROL_UP_NEG = 0x1 << CONTROL_UP_NEG_INDEX; // 0x00000020
-const U32 AGENT_CONTROL_PITCH_POS = 0x1 << CONTROL_PITCH_POS_INDEX; // 0x00000040
-const U32 AGENT_CONTROL_PITCH_NEG = 0x1 << CONTROL_PITCH_NEG_INDEX; // 0x00000080
-const U32 AGENT_CONTROL_YAW_POS = 0x1 << CONTROL_YAW_POS_INDEX; // 0x00000100
-const U32 AGENT_CONTROL_YAW_NEG = 0x1 << CONTROL_YAW_NEG_INDEX; // 0x00000200
-
-const U32 AGENT_CONTROL_FAST_AT = 0x1 << CONTROL_FAST_AT_INDEX; // 0x00000400
-const U32 AGENT_CONTROL_FAST_LEFT = 0x1 << CONTROL_FAST_LEFT_INDEX; // 0x00000800
-const U32 AGENT_CONTROL_FAST_UP = 0x1 << CONTROL_FAST_UP_INDEX; // 0x00001000
-
-const U32 AGENT_CONTROL_FLY = 0x1 << CONTROL_FLY_INDEX; // 0x00002000
-const U32 AGENT_CONTROL_STOP = 0x1 << CONTROL_STOP_INDEX; // 0x00004000
-const U32 AGENT_CONTROL_FINISH_ANIM = 0x1 << CONTROL_FINISH_ANIM_INDEX; // 0x00008000
-const U32 AGENT_CONTROL_STAND_UP = 0x1 << CONTROL_STAND_UP_INDEX; // 0x00010000
-const U32 AGENT_CONTROL_SIT_ON_GROUND = 0x1 << CONTROL_SIT_ON_GROUND_INDEX; // 0x00020000
-const U32 AGENT_CONTROL_MOUSELOOK = 0x1 << CONTROL_MOUSELOOK_INDEX; // 0x00040000
-
-const U32 AGENT_CONTROL_NUDGE_AT_POS = 0x1 << CONTROL_NUDGE_AT_POS_INDEX; // 0x00080000
-const U32 AGENT_CONTROL_NUDGE_AT_NEG = 0x1 << CONTROL_NUDGE_AT_NEG_INDEX; // 0x00100000
-const U32 AGENT_CONTROL_NUDGE_LEFT_POS = 0x1 << CONTROL_NUDGE_LEFT_POS_INDEX; // 0x00200000
-const U32 AGENT_CONTROL_NUDGE_LEFT_NEG = 0x1 << CONTROL_NUDGE_LEFT_NEG_INDEX; // 0x00400000
-const U32 AGENT_CONTROL_NUDGE_UP_POS = 0x1 << CONTROL_NUDGE_UP_POS_INDEX; // 0x00800000
-const U32 AGENT_CONTROL_NUDGE_UP_NEG = 0x1 << CONTROL_NUDGE_UP_NEG_INDEX; // 0x01000000
-const U32 AGENT_CONTROL_TURN_LEFT = 0x1 << CONTROL_TURN_LEFT_INDEX; // 0x02000000
-const U32 AGENT_CONTROL_TURN_RIGHT = 0x1 << CONTROL_TURN_RIGHT_INDEX; // 0x04000000
-
-const U32 AGENT_CONTROL_AWAY = 0x1 << CONTROL_AWAY_INDEX; // 0x08000000
-
-const U32 AGENT_CONTROL_LBUTTON_DOWN = 0x1 << CONTROL_LBUTTON_DOWN_INDEX; // 0x10000000
-const U32 AGENT_CONTROL_LBUTTON_UP = 0x1 << CONTROL_LBUTTON_UP_INDEX; // 0x20000000
-const U32 AGENT_CONTROL_ML_LBUTTON_DOWN = 0x1 << CONTROL_ML_LBUTTON_DOWN_INDEX; // 0x40000000
-const U32 AGENT_CONTROL_ML_LBUTTON_UP = ((U32)0x1) << CONTROL_ML_LBUTTON_UP_INDEX; // 0x80000000
+constexpr U32 CONTROL_AT_POS_INDEX = 0;
+constexpr U32 CONTROL_AT_NEG_INDEX = 1;
+constexpr U32 CONTROL_LEFT_POS_INDEX = 2;
+constexpr U32 CONTROL_LEFT_NEG_INDEX = 3;
+constexpr U32 CONTROL_UP_POS_INDEX = 4;
+constexpr U32 CONTROL_UP_NEG_INDEX = 5;
+constexpr U32 CONTROL_PITCH_POS_INDEX = 6;
+constexpr U32 CONTROL_PITCH_NEG_INDEX = 7;
+constexpr U32 CONTROL_YAW_POS_INDEX = 8;
+constexpr U32 CONTROL_YAW_NEG_INDEX = 9;
+constexpr U32 CONTROL_FAST_AT_INDEX = 10;
+constexpr U32 CONTROL_FAST_LEFT_INDEX = 11;
+constexpr U32 CONTROL_FAST_UP_INDEX = 12;
+constexpr U32 CONTROL_FLY_INDEX = 13;
+constexpr U32 CONTROL_STOP_INDEX = 14;
+constexpr U32 CONTROL_FINISH_ANIM_INDEX = 15;
+constexpr U32 CONTROL_STAND_UP_INDEX = 16;
+constexpr U32 CONTROL_SIT_ON_GROUND_INDEX = 17;
+constexpr U32 CONTROL_MOUSELOOK_INDEX = 18;
+constexpr U32 CONTROL_NUDGE_AT_POS_INDEX = 19;
+constexpr U32 CONTROL_NUDGE_AT_NEG_INDEX = 20;
+constexpr U32 CONTROL_NUDGE_LEFT_POS_INDEX = 21;
+constexpr U32 CONTROL_NUDGE_LEFT_NEG_INDEX = 22;
+constexpr U32 CONTROL_NUDGE_UP_POS_INDEX = 23;
+constexpr U32 CONTROL_NUDGE_UP_NEG_INDEX = 24;
+constexpr U32 CONTROL_TURN_LEFT_INDEX = 25;
+constexpr U32 CONTROL_TURN_RIGHT_INDEX = 26;
+constexpr U32 CONTROL_AWAY_INDEX = 27;
+constexpr U32 CONTROL_LBUTTON_DOWN_INDEX = 28;
+constexpr U32 CONTROL_LBUTTON_UP_INDEX = 29;
+constexpr U32 CONTROL_ML_LBUTTON_DOWN_INDEX = 30;
+constexpr U32 CONTROL_ML_LBUTTON_UP_INDEX = 31;
+constexpr U32 TOTAL_CONTROLS = 32;
+
+constexpr U32 AGENT_CONTROL_AT_POS = 0x1 << CONTROL_AT_POS_INDEX; // 0x00000001
+constexpr U32 AGENT_CONTROL_AT_NEG = 0x1 << CONTROL_AT_NEG_INDEX; // 0x00000002
+constexpr U32 AGENT_CONTROL_LEFT_POS = 0x1 << CONTROL_LEFT_POS_INDEX; // 0x00000004
+constexpr U32 AGENT_CONTROL_LEFT_NEG = 0x1 << CONTROL_LEFT_NEG_INDEX; // 0x00000008
+constexpr U32 AGENT_CONTROL_UP_POS = 0x1 << CONTROL_UP_POS_INDEX; // 0x00000010
+constexpr U32 AGENT_CONTROL_UP_NEG = 0x1 << CONTROL_UP_NEG_INDEX; // 0x00000020
+constexpr U32 AGENT_CONTROL_PITCH_POS = 0x1 << CONTROL_PITCH_POS_INDEX; // 0x00000040
+constexpr U32 AGENT_CONTROL_PITCH_NEG = 0x1 << CONTROL_PITCH_NEG_INDEX; // 0x00000080
+constexpr U32 AGENT_CONTROL_YAW_POS = 0x1 << CONTROL_YAW_POS_INDEX; // 0x00000100
+constexpr U32 AGENT_CONTROL_YAW_NEG = 0x1 << CONTROL_YAW_NEG_INDEX; // 0x00000200
+
+constexpr U32 AGENT_CONTROL_FAST_AT = 0x1 << CONTROL_FAST_AT_INDEX; // 0x00000400
+constexpr U32 AGENT_CONTROL_FAST_LEFT = 0x1 << CONTROL_FAST_LEFT_INDEX; // 0x00000800
+constexpr U32 AGENT_CONTROL_FAST_UP = 0x1 << CONTROL_FAST_UP_INDEX; // 0x00001000
+
+constexpr U32 AGENT_CONTROL_FLY = 0x1 << CONTROL_FLY_INDEX; // 0x00002000
+constexpr U32 AGENT_CONTROL_STOP = 0x1 << CONTROL_STOP_INDEX; // 0x00004000
+constexpr U32 AGENT_CONTROL_FINISH_ANIM = 0x1 << CONTROL_FINISH_ANIM_INDEX; // 0x00008000
+constexpr U32 AGENT_CONTROL_STAND_UP = 0x1 << CONTROL_STAND_UP_INDEX; // 0x00010000
+constexpr U32 AGENT_CONTROL_SIT_ON_GROUND = 0x1 << CONTROL_SIT_ON_GROUND_INDEX; // 0x00020000
+constexpr U32 AGENT_CONTROL_MOUSELOOK = 0x1 << CONTROL_MOUSELOOK_INDEX; // 0x00040000
+
+constexpr U32 AGENT_CONTROL_NUDGE_AT_POS = 0x1 << CONTROL_NUDGE_AT_POS_INDEX; // 0x00080000
+constexpr U32 AGENT_CONTROL_NUDGE_AT_NEG = 0x1 << CONTROL_NUDGE_AT_NEG_INDEX; // 0x00100000
+constexpr U32 AGENT_CONTROL_NUDGE_LEFT_POS = 0x1 << CONTROL_NUDGE_LEFT_POS_INDEX; // 0x00200000
+constexpr U32 AGENT_CONTROL_NUDGE_LEFT_NEG = 0x1 << CONTROL_NUDGE_LEFT_NEG_INDEX; // 0x00400000
+constexpr U32 AGENT_CONTROL_NUDGE_UP_POS = 0x1 << CONTROL_NUDGE_UP_POS_INDEX; // 0x00800000
+constexpr U32 AGENT_CONTROL_NUDGE_UP_NEG = 0x1 << CONTROL_NUDGE_UP_NEG_INDEX; // 0x01000000
+constexpr U32 AGENT_CONTROL_TURN_LEFT = 0x1 << CONTROL_TURN_LEFT_INDEX; // 0x02000000
+constexpr U32 AGENT_CONTROL_TURN_RIGHT = 0x1 << CONTROL_TURN_RIGHT_INDEX; // 0x04000000
+
+constexpr U32 AGENT_CONTROL_AWAY = 0x1 << CONTROL_AWAY_INDEX; // 0x08000000
+
+constexpr U32 AGENT_CONTROL_LBUTTON_DOWN = 0x1 << CONTROL_LBUTTON_DOWN_INDEX; // 0x10000000
+constexpr U32 AGENT_CONTROL_LBUTTON_UP = 0x1 << CONTROL_LBUTTON_UP_INDEX; // 0x20000000
+constexpr U32 AGENT_CONTROL_ML_LBUTTON_DOWN = 0x1 << CONTROL_ML_LBUTTON_DOWN_INDEX; // 0x40000000
+constexpr U32 AGENT_CONTROL_ML_LBUTTON_UP = ((U32)0x1) << CONTROL_ML_LBUTTON_UP_INDEX; // 0x80000000
// move these up so that we can hide them in "State" for object updates
// (for now)
-const U32 AGENT_ATTACH_OFFSET = 4;
-const U32 AGENT_ATTACH_MASK = 0xf << AGENT_ATTACH_OFFSET;
+constexpr U32 AGENT_ATTACH_OFFSET = 4;
+constexpr U32 AGENT_ATTACH_MASK = 0xf << AGENT_ATTACH_OFFSET;
// RN: this method swaps the upper and lower nibbles to maintain backward
// compatibility with old objects that only used the upper nibble
#define ATTACHMENT_ID_FROM_STATE(state) ((S32)((((U8)state & AGENT_ATTACH_MASK) >> 4) | (((U8)state & ~AGENT_ATTACH_MASK) << 4)))
// DO NOT CHANGE THE SEQUENCE OF THIS LIST!!
-const U8 CLICK_ACTION_NONE = 0;
-const U8 CLICK_ACTION_TOUCH = 0;
-const U8 CLICK_ACTION_SIT = 1;
-const U8 CLICK_ACTION_BUY = 2;
-const U8 CLICK_ACTION_PAY = 3;
-const U8 CLICK_ACTION_OPEN = 4;
-const U8 CLICK_ACTION_PLAY = 5;
-const U8 CLICK_ACTION_OPEN_MEDIA = 6;
-const U8 CLICK_ACTION_ZOOM = 7;
-const U8 CLICK_ACTION_DISABLED = 8;
-const U8 CLICK_ACTION_IGNORE = 9;
+constexpr U8 CLICK_ACTION_NONE = 0;
+constexpr U8 CLICK_ACTION_TOUCH = 0;
+constexpr U8 CLICK_ACTION_SIT = 1;
+constexpr U8 CLICK_ACTION_BUY = 2;
+constexpr U8 CLICK_ACTION_PAY = 3;
+constexpr U8 CLICK_ACTION_OPEN = 4;
+constexpr U8 CLICK_ACTION_PLAY = 5;
+constexpr U8 CLICK_ACTION_OPEN_MEDIA = 6;
+constexpr U8 CLICK_ACTION_ZOOM = 7;
+constexpr U8 CLICK_ACTION_DISABLED = 8;
+constexpr U8 CLICK_ACTION_IGNORE = 9;
// DO NOT CHANGE THE SEQUENCE OF THIS LIST!!
+constexpr U32 BEACON_SHOW_MAP = 0x0001;
+constexpr U32 BEACON_FOCUS_MAP = 0x0002;
#endif
diff --git a/indra/llcommon/lldefs.h b/indra/llcommon/lldefs.h
index 2fbb26dc1a..232987da14 100644
--- a/indra/llcommon/lldefs.h
+++ b/indra/llcommon/lldefs.h
@@ -171,13 +171,13 @@ constexpr U32 MAXADDRSTR = 17; // 123.567.901.345 = 15 chars + \0 +
// recursion tail
template <typename T>
-inline auto llmax(T data)
+constexpr auto llmax(T data)
{
return data;
}
template <typename T0, typename T1, typename... Ts>
-inline auto llmax(T0 d0, T1 d1, Ts... rest)
+constexpr auto llmax(T0 d0, T1 d1, Ts... rest)
{
auto maxrest = llmax(d1, rest...);
return (d0 > maxrest)? d0 : maxrest;
@@ -185,20 +185,20 @@ inline auto llmax(T0 d0, T1 d1, Ts... rest)
// recursion tail
template <typename T>
-inline auto llmin(T data)
+constexpr auto llmin(T data)
{
return data;
}
template <typename T0, typename T1, typename... Ts>
-inline auto llmin(T0 d0, T1 d1, Ts... rest)
+constexpr auto llmin(T0 d0, T1 d1, Ts... rest)
{
auto minrest = llmin(d1, rest...);
return (d0 < minrest) ? d0 : minrest;
}
template <typename A, typename MIN, typename MAX>
-inline A llclamp(A a, MIN minval, MAX maxval)
+constexpr A llclamp(A a, MIN minval, MAX maxval)
{
A aminval{ static_cast<A>(minval) }, amaxval{ static_cast<A>(maxval) };
if ( a < aminval )
@@ -213,13 +213,13 @@ inline A llclamp(A a, MIN minval, MAX maxval)
}
template <class LLDATATYPE>
-inline LLDATATYPE llclampf(LLDATATYPE a)
+constexpr LLDATATYPE llclampf(LLDATATYPE a)
{
return llmin(llmax(a, LLDATATYPE(0)), LLDATATYPE(1));
}
template <class LLDATATYPE>
-inline LLDATATYPE llclampb(LLDATATYPE a)
+constexpr LLDATATYPE llclampb(LLDATATYPE a)
{
return llmin(llmax(a, LLDATATYPE(0)), LLDATATYPE(255));
}
diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp
index 9b3cdf4df5..56fd0fa7b3 100644
--- a/indra/llcommon/llprocessor.cpp
+++ b/indra/llcommon/llprocessor.cpp
@@ -638,7 +638,8 @@ public:
{
getCPUIDInfo();
uint64_t frequency = getSysctlInt64("hw.cpufrequency");
- if (!frequency) {
+ if (!frequency)
+ {
auto tbfrequency = getSysctlInt64("hw.tbfrequency");
struct clockinfo clockrate;
auto clockrate_len = sizeof(clockrate);
diff --git a/indra/llcommon/stdtypes.h b/indra/llcommon/stdtypes.h
index b40a718593..78d5e50e4b 100644
--- a/indra/llcommon/stdtypes.h
+++ b/indra/llcommon/stdtypes.h
@@ -169,14 +169,14 @@ private:
FROM mValue;
public:
- narrow(FROM value): mValue(value) {}
+ constexpr narrow(FROM value): mValue(value) {}
/*---------------------- Narrowing unsigned to signed ----------------------*/
template <typename TO,
typename std::enable_if<std::is_unsigned<FROM>::value &&
std::is_signed<TO>::value,
bool>::type = true>
- inline
+ constexpr
operator TO() const
{
// The reason we skip the
@@ -194,7 +194,7 @@ public:
typename std::enable_if<! (std::is_unsigned<FROM>::value &&
std::is_signed<TO>::value),
bool>::type = true>
- inline
+ constexpr
operator TO() const
{
// two different assert()s so we can tell which condition failed
diff --git a/indra/llcommon/threadpool.h b/indra/llcommon/threadpool.h
index 0eb1891754..ac4f415f3e 100644
--- a/indra/llcommon/threadpool.h
+++ b/indra/llcommon/threadpool.h
@@ -55,7 +55,7 @@ namespace LL
* ThreadPool listens for application shutdown messages on the "LLApp"
* LLEventPump. Call close() to shut down this ThreadPool early.
*/
- virtual void close();
+ void close();
std::string getName() const { return mName; }
size_t getWidth() const { return mThreads.size(); }
@@ -122,7 +122,7 @@ namespace LL
size_t threads=1,
size_t capacity=1024*1024,
bool auto_shutdown = true):
- ThreadPoolBase(name, threads, new queue_t(name, capacity), auto_shutdown)
+ ThreadPoolBase(name, threads, new queue_t(name, capacity, false), auto_shutdown)
{}
~ThreadPoolUsing() override {}
diff --git a/indra/llcommon/workqueue.cpp b/indra/llcommon/workqueue.cpp
index c8ece616b2..323903e59c 100644
--- a/indra/llcommon/workqueue.cpp
+++ b/indra/llcommon/workqueue.cpp
@@ -30,12 +30,15 @@ using Lock = LLCoros::LockType;
/*****************************************************************************
* WorkQueueBase
*****************************************************************************/
-LL::WorkQueueBase::WorkQueueBase(const std::string& name):
- super(makeName(name))
+LL::WorkQueueBase::WorkQueueBase(const std::string& name, bool auto_shutdown)
+ : super(makeName(name))
+{
+ if (auto_shutdown)
{
// TODO: register for "LLApp" events so we can implicitly close() on
// viewer shutdown.
}
+}
void LL::WorkQueueBase::runUntilClose()
{
@@ -212,8 +215,8 @@ void LL::WorkQueueBase::checkCoroutine(const std::string& method)
/*****************************************************************************
* WorkQueue
*****************************************************************************/
-LL::WorkQueue::WorkQueue(const std::string& name, size_t capacity):
- super(name),
+LL::WorkQueue::WorkQueue(const std::string& name, size_t capacity, bool auto_shutdown):
+ super(name, auto_shutdown),
mQueue(capacity)
{
}
@@ -261,8 +264,8 @@ bool LL::WorkQueue::tryPop_(Work& work)
/*****************************************************************************
* WorkSchedule
*****************************************************************************/
-LL::WorkSchedule::WorkSchedule(const std::string& name, size_t capacity):
- super(name),
+LL::WorkSchedule::WorkSchedule(const std::string& name, size_t capacity, bool auto_shutdown):
+ super(name, auto_shutdown),
mQueue(capacity)
{
}
diff --git a/indra/llcommon/workqueue.h b/indra/llcommon/workqueue.h
index 9d7bbfbf7a..d424ca6e1c 100644
--- a/indra/llcommon/workqueue.h
+++ b/indra/llcommon/workqueue.h
@@ -51,7 +51,7 @@ namespace LL
* You may omit the WorkQueueBase name, in which case a unique name is
* synthesized; for practical purposes that makes it anonymous.
*/
- WorkQueueBase(const std::string& name);
+ WorkQueueBase(const std::string& name, bool auto_shutdown);
/**
* Since the point of WorkQueue is to pass work to some other worker
@@ -212,7 +212,7 @@ namespace LL
* You may omit the WorkQueue name, in which case a unique name is
* synthesized; for practical purposes that makes it anonymous.
*/
- WorkQueue(const std::string& name = std::string(), size_t capacity=1024);
+ WorkQueue(const std::string& name = std::string(), size_t capacity=1024, bool auto_shutdown = true);
/**
* Since the point of WorkQueue is to pass work to some other worker
@@ -282,7 +282,7 @@ namespace LL
* You may omit the WorkSchedule name, in which case a unique name is
* synthesized; for practical purposes that makes it anonymous.
*/
- WorkSchedule(const std::string& name = std::string(), size_t capacity=1024);
+ WorkSchedule(const std::string& name = std::string(), size_t capacity=1024, bool auto_shutdown = true);
/**
* Since the point of WorkSchedule is to pass work to some other worker
diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp
index 075abf9536..5bf8020a68 100644
--- a/indra/llinventory/llinventory.cpp
+++ b/indra/llinventory/llinventory.cpp
@@ -46,6 +46,7 @@ static const std::string INV_ITEM_ID_LABEL("item_id");
static const std::string INV_FOLDER_ID_LABEL("cat_id");
static const std::string INV_PARENT_ID_LABEL("parent_id");
static const std::string INV_THUMBNAIL_LABEL("thumbnail");
+static const std::string INV_FAVORITE_LABEL("favorite");
static const std::string INV_THUMBNAIL_ID_LABEL("thumbnail_id");
static const std::string INV_ASSET_TYPE_LABEL("type");
static const std::string INV_PREFERRED_TYPE_LABEL("preferred_type");
@@ -59,6 +60,7 @@ static const std::string INV_LINKED_ID_LABEL("linked_id");
static const std::string INV_SALE_INFO_LABEL("sale_info");
static const std::string INV_FLAGS_LABEL("flags");
static const std::string INV_CREATION_DATE_LABEL("created_at");
+static const std::string INV_TOGGLED_LABEL("toggled");
// key used by agent-inventory-service
static const std::string INV_ASSET_TYPE_LABEL_WS("type_default");
@@ -82,14 +84,16 @@ LLInventoryObject::LLInventoryObject(const LLUUID& uuid,
mParentUUID(parent_uuid),
mType(type),
mName(name),
- mCreationDate(0)
+ mCreationDate(0),
+ mFavorite(false)
{
correctInventoryName(mName);
}
LLInventoryObject::LLInventoryObject()
: mType(LLAssetType::AT_NONE),
- mCreationDate(0)
+ mCreationDate(0),
+ mFavorite(false)
{
}
@@ -104,6 +108,7 @@ void LLInventoryObject::copyObject(const LLInventoryObject* other)
mType = other->mType;
mName = other->mName;
mThumbnailUUID = other->mThumbnailUUID;
+ mFavorite = other->mFavorite;
}
const LLUUID& LLInventoryObject::getUUID() const
@@ -121,6 +126,11 @@ const LLUUID& LLInventoryObject::getThumbnailUUID() const
return mThumbnailUUID;
}
+bool LLInventoryObject::getIsFavorite() const
+{
+ return mFavorite;
+}
+
const std::string& LLInventoryObject::getName() const
{
return mName;
@@ -175,6 +185,11 @@ void LLInventoryObject::setThumbnailUUID(const LLUUID& thumbnail_uuid)
mThumbnailUUID = thumbnail_uuid;
}
+void LLInventoryObject::setFavorite(bool favorite)
+{
+ mFavorite = favorite;
+}
+
void LLInventoryObject::setType(LLAssetType::EType type)
{
mType = type;
@@ -247,6 +262,23 @@ bool LLInventoryObject::importLegacyStream(std::istream& input_stream)
{
setThumbnailUUID(LLUUID::null);
}
+
+ if (metadata.has("favorite"))
+ {
+ const LLSD& favorite = metadata["favorite"];
+ if (favorite.has("toggled"))
+ {
+ setFavorite(favorite["toggled"].asBoolean());
+ }
+ else
+ {
+ setFavorite(false);
+ }
+ }
+ else
+ {
+ setFavorite(false);
+ }
}
else if(0 == strcmp("name", keyword))
{
@@ -735,6 +767,23 @@ bool LLInventoryItem::importLegacyStream(std::istream& input_stream)
{
setThumbnailUUID(LLUUID::null);
}
+
+ if (metadata.has("favorite"))
+ {
+ const LLSD& favorite = metadata["favorite"];
+ if (favorite.has("toggled"))
+ {
+ setFavorite(favorite["toggled"].asBoolean());
+ }
+ else
+ {
+ setFavorite(false);
+ }
+ }
+ else
+ {
+ setFavorite(false);
+ }
}
else if(0 == strcmp("inv_type", keyword))
{
@@ -895,6 +944,11 @@ void LLInventoryItem::asLLSD( LLSD& sd ) const
sd[INV_THUMBNAIL_LABEL] = LLSD().with(INV_ASSET_ID_LABEL, mThumbnailUUID);
}
+ if (mFavorite)
+ {
+ sd[INV_FAVORITE_LABEL] = LLSD().with(INV_TOGGLED_LABEL, mFavorite);
+ }
+
U32 mask = mPermissions.getMaskBase();
if(((mask & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED)
|| (mAssetUUID.isNull()))
@@ -937,6 +991,7 @@ bool LLInventoryItem::fromLLSD(const LLSD& sd, bool is_new)
// TODO - figure out if this should be moved into the noclobber fields above
mThumbnailUUID.setNull();
+ mFavorite = false;
// iterate as map to avoid making unnecessary temp copies of everything
LLSD::map_const_iterator i, end;
@@ -982,6 +1037,17 @@ bool LLInventoryItem::fromLLSD(const LLSD& sd, bool is_new)
continue;
}
+ if (i->first == INV_FAVORITE_LABEL)
+ {
+ const LLSD& favorite_map = i->second;
+ const std::string w = INV_TOGGLED_LABEL;
+ if (favorite_map.has(w))
+ {
+ mFavorite = favorite_map[w].asBoolean();
+ }
+ continue;
+ }
+
if (i->first == INV_PERMISSIONS_LABEL)
{
mPermissions = ll_permissions_from_sd(i->second);
@@ -1177,6 +1243,11 @@ LLSD LLInventoryCategory::asLLSD() const
sd[INV_THUMBNAIL_LABEL] = LLSD().with(INV_ASSET_ID_LABEL, mThumbnailUUID);
}
+ if (mFavorite)
+ {
+ sd[INV_FAVORITE_LABEL] = LLSD().with(INV_TOGGLED_LABEL, mFavorite);
+ }
+
return sd;
}
@@ -1188,11 +1259,17 @@ LLSD LLInventoryCategory::asAISCreateCatLLSD() const
S8 type = static_cast<S8>(mPreferredType);
sd[INV_ASSET_TYPE_LABEL_WS] = type;
sd[INV_NAME_LABEL] = mName;
+
if (mThumbnailUUID.notNull())
{
sd[INV_THUMBNAIL_LABEL] = LLSD().with(INV_ASSET_ID_LABEL, mThumbnailUUID);
}
+ if (mFavorite)
+ {
+ sd[INV_FAVORITE_LABEL] = LLSD().with(INV_TOGGLED_LABEL, mFavorite);
+ }
+
return sd;
}
@@ -1240,6 +1317,17 @@ bool LLInventoryCategory::fromLLSD(const LLSD& sd)
mThumbnailUUID = sd[w];
}
}
+ mFavorite = false;
+ w = INV_FAVORITE_LABEL;
+ if (sd.has(w))
+ {
+ const LLSD& favorite_map = sd[w];
+ w = INV_TOGGLED_LABEL;
+ if (favorite_map.has(w))
+ {
+ mFavorite = favorite_map[w].asBoolean();
+ }
+ }
w = INV_ASSET_TYPE_LABEL;
if (sd.has(w))
{
@@ -1362,6 +1450,23 @@ bool LLInventoryCategory::importLegacyStream(std::istream& input_stream)
{
setThumbnailUUID(LLUUID::null);
}
+
+ if (metadata.has("favorite"))
+ {
+ const LLSD& favorite = metadata["favorite"];
+ if (favorite.has("toggled"))
+ {
+ setFavorite(favorite["toggled"].asBoolean());
+ }
+ else
+ {
+ setFavorite(false);
+ }
+ }
+ else
+ {
+ setFavorite(false);
+ }
}
else
{
@@ -1409,6 +1514,10 @@ LLSD LLInventoryCategory::exportLLSD() const
{
cat_data[INV_THUMBNAIL_LABEL] = LLSD().with(INV_ASSET_ID_LABEL, mThumbnailUUID);
}
+ if (mFavorite)
+ {
+ cat_data[INV_FAVORITE_LABEL] = LLSD().with(INV_TOGGLED_LABEL, mFavorite);
+ }
return cat_data;
}
@@ -1441,6 +1550,16 @@ bool LLInventoryCategory::importLLSD(const LLSD& cat_data)
}
setThumbnailUUID(thumbnail_uuid);
}
+ if (cat_data.has(INV_FAVORITE_LABEL))
+ {
+ bool favorite = false;
+ const LLSD& favorite_data = cat_data[INV_FAVORITE_LABEL];
+ if (favorite_data.has(INV_TOGGLED_LABEL))
+ {
+ favorite = favorite_data[INV_TOGGLED_LABEL].asBoolean();
+ }
+ setFavorite(favorite);
+ }
if (cat_data.has(INV_NAME_LABEL))
{
mName = cat_data[INV_NAME_LABEL].asString();
diff --git a/indra/llinventory/llinventory.h b/indra/llinventory/llinventory.h
index e63f2deba7..2044b0102c 100644
--- a/indra/llinventory/llinventory.h
+++ b/indra/llinventory/llinventory.h
@@ -71,6 +71,7 @@ public:
virtual const LLUUID& getLinkedUUID() const; // inventoryID that this item points to, else this item's inventoryID
const LLUUID& getParentUUID() const;
virtual const LLUUID& getThumbnailUUID() const;
+ virtual bool getIsFavorite() const;
virtual const std::string& getName() const;
virtual LLAssetType::EType getType() const;
LLAssetType::EType getActualType() const; // bypasses indirection for linked items
@@ -86,6 +87,7 @@ public:
virtual void rename(const std::string& new_name);
void setParent(const LLUUID& new_parent);
virtual void setThumbnailUUID(const LLUUID& thumbnail_uuid);
+ virtual void setFavorite(bool favorite);
void setType(LLAssetType::EType type);
virtual void setCreationDate(time_t creation_date_utc); // only stored for items
@@ -111,6 +113,7 @@ protected:
LLUUID mUUID;
LLUUID mParentUUID; // Parent category. Root categories have LLUUID::NULL.
LLUUID mThumbnailUUID;
+ bool mFavorite;
LLAssetType::EType mType;
std::string mName;
time_t mCreationDate; // seconds from 1/1/1970, UTC
diff --git a/indra/llinventory/llparcel.h b/indra/llinventory/llparcel.h
index 67d713db1f..759638b956 100644
--- a/indra/llinventory/llparcel.h
+++ b/indra/llinventory/llparcel.h
@@ -262,6 +262,8 @@ public:
void setMediaURLResetTimer(F32 time);
virtual void setLocalID(S32 local_id);
+ void setRegionID(const LLUUID& id) { mRegionID = id; }
+ const LLUUID& getRegionID() const { return mRegionID; }
// blow away all the extra stuff lurking in parcels, including urls, access lists, etc
void clearParcel();
@@ -651,6 +653,7 @@ public:
S32 mLocalID;
LLUUID mBanListTransactionID;
LLUUID mAccessListTransactionID;
+ LLUUID mRegionID;
std::map<LLUUID,LLAccessEntry> mAccessList;
std::map<LLUUID,LLAccessEntry> mBanList;
std::map<LLUUID,LLAccessEntry> mTempBanList;
diff --git a/indra/llmath/llcamera.h b/indra/llmath/llcamera.h
index b6e0e4a2be..6201761c46 100644
--- a/indra/llmath/llcamera.h
+++ b/indra/llmath/llcamera.h
@@ -33,23 +33,23 @@
#include "llplane.h"
#include "llvector4a.h"
-const F32 DEFAULT_FIELD_OF_VIEW = 60.f * DEG_TO_RAD;
-const F32 DEFAULT_ASPECT_RATIO = 640.f / 480.f;
-const F32 DEFAULT_NEAR_PLANE = 0.25f;
-const F32 DEFAULT_FAR_PLANE = 64.f; // far reaches across two horizontal, not diagonal, regions
+constexpr F32 DEFAULT_FIELD_OF_VIEW = 60.f * DEG_TO_RAD;
+constexpr F32 DEFAULT_ASPECT_RATIO = 640.f / 480.f;
+constexpr F32 DEFAULT_NEAR_PLANE = 0.25f;
+constexpr F32 DEFAULT_FAR_PLANE = 64.f; // far reaches across two horizontal, not diagonal, regions
-const F32 MAX_ASPECT_RATIO = 50.0f;
-const F32 MAX_NEAR_PLANE = 1023.9f; // Clamp the near plane just before the skybox ends
-const F32 MAX_FAR_PLANE = 100000.0f; //1000000.0f; // Max allowed. Not good Z precision though.
-const F32 MAX_FAR_CLIP = 512.0f;
+constexpr F32 MAX_ASPECT_RATIO = 50.0f;
+constexpr F32 MAX_NEAR_PLANE = 1023.9f; // Clamp the near plane just before the skybox ends
+constexpr F32 MAX_FAR_PLANE = 100000.0f; //1000000.0f; // Max allowed. Not good Z precision though.
+constexpr F32 MAX_FAR_CLIP = 512.0f;
-const F32 MIN_ASPECT_RATIO = 0.02f;
-const F32 MIN_NEAR_PLANE = 0.1f;
-const F32 MIN_FAR_PLANE = 0.2f;
+constexpr F32 MIN_ASPECT_RATIO = 0.02f;
+constexpr F32 MIN_NEAR_PLANE = 0.1f;
+constexpr F32 MIN_FAR_PLANE = 0.2f;
// Min/Max FOV values for square views. Call getMin/MaxView to get extremes based on current aspect ratio.
-static const F32 MIN_FIELD_OF_VIEW = 5.0f * DEG_TO_RAD;
-static const F32 MAX_FIELD_OF_VIEW = 175.f * DEG_TO_RAD;
+constexpr F32 MIN_FIELD_OF_VIEW = 5.0f * DEG_TO_RAD;
+constexpr F32 MAX_FIELD_OF_VIEW = 175.f * DEG_TO_RAD;
// An LLCamera is an LLCoorFrame with a view frustum.
// This means that it has several methods for moving it around
diff --git a/indra/llmath/llcoordframe.cpp b/indra/llmath/llcoordframe.cpp
index 4d6276b2cd..b42541c7c0 100644
--- a/indra/llmath/llcoordframe.cpp
+++ b/indra/llmath/llcoordframe.cpp
@@ -26,7 +26,6 @@
#include "linden_common.h"
-//#include "vmath.h"
#include "v3math.h"
#include "m3math.h"
#include "v4math.h"
@@ -329,28 +328,30 @@ void LLCoordFrame::rotate(const LLMatrix3 &rotation_matrix)
}
+// Rotate 2 normalized orthogonal vectors in direction from `source` to `target`
+static void rotate2(LLVector3& source, LLVector3& target, F32 angle)
+{
+ F32 sx = source[VX], sy = source[VY], sz = source[VZ];
+ F32 tx = target[VX], ty = target[VY], tz = target[VZ];
+ F32 c = cosf(angle), s = sinf(angle);
+
+ source.set(sx * c + tx * s, sy * c + ty * s, sz * c + tz * s);
+ target.set(tx * c - sx * s, ty * c - sy * s, tz * c - sz * s);
+}
+
void LLCoordFrame::roll(F32 angle)
{
- LLQuaternion q(angle, mXAxis);
- LLMatrix3 rotation_matrix(q);
- rotate(rotation_matrix);
- CHECK_FINITE_OBJ();
+ rotate2(mYAxis, mZAxis, angle);
}
void LLCoordFrame::pitch(F32 angle)
{
- LLQuaternion q(angle, mYAxis);
- LLMatrix3 rotation_matrix(q);
- rotate(rotation_matrix);
- CHECK_FINITE_OBJ();
+ rotate2(mZAxis, mXAxis, angle);
}
void LLCoordFrame::yaw(F32 angle)
{
- LLQuaternion q(angle, mZAxis);
- LLMatrix3 rotation_matrix(q);
- rotate(rotation_matrix);
- CHECK_FINITE_OBJ();
+ rotate2(mXAxis, mYAxis, angle);
}
// get*() routines
diff --git a/indra/llmath/llcoordframe.h b/indra/llmath/llcoordframe.h
index aaa701f792..458f6132c9 100644
--- a/indra/llmath/llcoordframe.h
+++ b/indra/llmath/llcoordframe.h
@@ -61,7 +61,7 @@ public:
//LLCoordFrame(const F32 *origin, const F32 *rotation); // Assumes "origin" is 1x3 and "rotation" is 1x9 array
//LLCoordFrame(const F32 *origin_and_rotation); // Assumes "origin_and_rotation" is 1x12 array
- bool isFinite() { return mOrigin.isFinite() && mXAxis.isFinite() && mYAxis.isFinite() && mZAxis.isFinite(); }
+ bool isFinite() const { return mOrigin.isFinite() && mXAxis.isFinite() && mYAxis.isFinite() && mZAxis.isFinite(); }
void reset();
void resetAxes();
diff --git a/indra/llmath/llline.h b/indra/llmath/llline.h
index 33c1eb61a4..e98e173d1f 100644
--- a/indra/llmath/llline.h
+++ b/indra/llmath/llline.h
@@ -33,7 +33,7 @@
#include "stdtypes.h"
#include "v3math.h"
-const F32 DEFAULT_INTERSECTION_ERROR = 0.000001f;
+constexpr F32 DEFAULT_INTERSECTION_ERROR = 0.000001f;
class LLLine
{
diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h
index a72993a21a..891f0ffc4c 100644
--- a/indra/llmath/llmath.h
+++ b/indra/llmath/llmath.h
@@ -39,18 +39,8 @@
// llcommon depend on llmath.
#include "is_approx_equal_fraction.h"
-// work around for Windows & older gcc non-standard function names.
-#if LL_WINDOWS
-#include <float.h>
-#define llisnan(val) _isnan(val)
-#define llfinite(val) _finite(val)
-#elif (LL_LINUX && __GNUC__ <= 2)
-#define llisnan(val) isnan(val)
-#define llfinite(val) isfinite(val)
-#else
-#define llisnan(val) std::isnan(val)
-#define llfinite(val) std::isfinite(val)
-#endif
+#define llisnan(val) std::isnan(val)
+#define llfinite(val) std::isfinite(val)
// Single Precision Floating Point Routines
// (There used to be more defined here, but they appeared to be redundant and
@@ -75,7 +65,7 @@ constexpr F32 DEG_TO_RAD = 0.017453292519943295769236907684886f;
constexpr F32 RAD_TO_DEG = 57.295779513082320876798154814105f;
constexpr F32 F_APPROXIMATELY_ZERO = 0.00001f;
constexpr F32 F_LN10 = 2.3025850929940456840179914546844f;
-constexpr F32 OO_LN10 = 0.43429448190325182765112891891661;
+constexpr F32 OO_LN10 = 0.43429448190325182765112891891661f;
constexpr F32 F_LN2 = 0.69314718056f;
constexpr F32 OO_LN2 = 1.4426950408889634073599246810019f;
@@ -89,7 +79,7 @@ constexpr F32 GIMBAL_THRESHOLD = 0.000436f; // sets the gimballock threshold 0
constexpr F32 FP_MAG_THRESHOLD = 0.0000001f;
// TODO: Replace with logic like is_approx_equal
-inline bool is_approx_zero( F32 f ) { return (-F_APPROXIMATELY_ZERO < f) && (f < F_APPROXIMATELY_ZERO); }
+constexpr bool is_approx_zero(F32 f) { return (-F_APPROXIMATELY_ZERO < f) && (f < F_APPROXIMATELY_ZERO); }
// These functions work by interpreting sign+exp+mantissa as an unsigned
// integer.
@@ -148,33 +138,17 @@ inline F64 llabs(const F64 a)
return F64(std::fabs(a));
}
-inline S32 lltrunc( F32 f )
+constexpr S32 lltrunc(F32 f)
{
-#if LL_WINDOWS && !defined( __INTEL_COMPILER ) && (ADDRESS_SIZE == 32)
- // Avoids changing the floating point control word.
- // Add or subtract 0.5 - epsilon and then round
- const static U32 zpfp[] = { 0xBEFFFFFF, 0x3EFFFFFF };
- S32 result;
- __asm {
- fld f
- mov eax, f
- shr eax, 29
- and eax, 4
- fadd dword ptr [zpfp + eax]
- fistp result
- }
- return result;
-#else
- return (S32)f;
-#endif
+ return narrow(f);
}
-inline S32 lltrunc( F64 f )
+constexpr S32 lltrunc(F64 f)
{
- return (S32)f;
+ return narrow(f);
}
-inline S32 llfloor( F32 f )
+inline S32 llfloor(F32 f)
{
#if LL_WINDOWS && !defined( __INTEL_COMPILER ) && (ADDRESS_SIZE == 32)
// Avoids changing the floating point control word.
@@ -284,7 +258,7 @@ constexpr F32 FAST_MAG_BETA = 0.397824734759f;
//constexpr F32 FAST_MAG_ALPHA = 0.948059448969f;
//constexpr F32 FAST_MAG_BETA = 0.392699081699f;
-inline F32 fastMagnitude(F32 a, F32 b)
+constexpr F32 fastMagnitude(F32 a, F32 b)
{
a = (a > 0) ? a : -a;
b = (b > 0) ? b : -b;
@@ -342,7 +316,7 @@ inline F32 llfastpow(const F32 x, const F32 y)
}
-inline F32 snap_to_sig_figs(F32 foo, S32 sig_figs)
+constexpr F32 snap_to_sig_figs(F32 foo, S32 sig_figs)
{
// compute the power of ten
F32 bar = 1.f;
@@ -358,16 +332,9 @@ inline F32 snap_to_sig_figs(F32 foo, S32 sig_figs)
return new_foo;
}
-#ifdef __GNUC__
using std::lerp;
-#else
-inline F32 lerp(F32 a, F32 b, F32 u)
-{
- return a + ((b - a) * u);
-}
-#endif
-inline F32 lerp2d(F32 x00, F32 x01, F32 x10, F32 x11, F32 u, F32 v)
+constexpr F32 lerp2d(F32 x00, F32 x01, F32 x10, F32 x11, F32 u, F32 v)
{
F32 a = x00 + (x01-x00)*u;
F32 b = x10 + (x11-x10)*u;
@@ -375,17 +342,17 @@ inline F32 lerp2d(F32 x00, F32 x01, F32 x10, F32 x11, F32 u, F32 v)
return r;
}
-inline F32 ramp(F32 x, F32 a, F32 b)
+constexpr F32 ramp(F32 x, F32 a, F32 b)
{
return (a == b) ? 0.0f : ((a - x) / (a - b));
}
-inline F32 rescale(F32 x, F32 x1, F32 x2, F32 y1, F32 y2)
+constexpr F32 rescale(F32 x, F32 x1, F32 x2, F32 y1, F32 y2)
{
return lerp(y1, y2, ramp(x, x1, x2));
}
-inline F32 clamp_rescale(F32 x, F32 x1, F32 x2, F32 y1, F32 y2)
+constexpr F32 clamp_rescale(F32 x, F32 x1, F32 x2, F32 y1, F32 y2)
{
if (y1 < y2)
{
@@ -398,7 +365,7 @@ inline F32 clamp_rescale(F32 x, F32 x1, F32 x2, F32 y1, F32 y2)
}
-inline F32 cubic_step( F32 x, F32 x0, F32 x1, F32 s0, F32 s1 )
+constexpr F32 cubic_step( F32 x, F32 x0, F32 x1, F32 s0, F32 s1 )
{
if (x <= x0)
return s0;
@@ -411,14 +378,14 @@ inline F32 cubic_step( F32 x, F32 x0, F32 x1, F32 s0, F32 s1 )
return s0 + (s1 - s0) * (f * f) * (3.0f - 2.0f * f);
}
-inline F32 cubic_step( F32 x )
+constexpr F32 cubic_step( F32 x )
{
x = llclampf(x);
return (x * x) * (3.0f - 2.0f * x);
}
-inline F32 quadratic_step( F32 x, F32 x0, F32 x1, F32 s0, F32 s1 )
+constexpr F32 quadratic_step( F32 x, F32 x0, F32 x1, F32 s0, F32 s1 )
{
if (x <= x0)
return s0;
@@ -432,7 +399,7 @@ inline F32 quadratic_step( F32 x, F32 x0, F32 x1, F32 s0, F32 s1 )
return (s0 * (1.f - f_squared)) + ((s1 - s0) * f_squared);
}
-inline F32 llsimple_angle(F32 angle)
+constexpr F32 llsimple_angle(F32 angle)
{
while(angle <= -F_PI)
angle += F_TWO_PI;
@@ -442,7 +409,7 @@ inline F32 llsimple_angle(F32 angle)
}
//SDK - Renamed this to get_lower_power_two, since this is what this actually does.
-inline U32 get_lower_power_two(U32 val, U32 max_power_two)
+constexpr U32 get_lower_power_two(U32 val, U32 max_power_two)
{
if(!max_power_two)
{
@@ -464,7 +431,7 @@ inline U32 get_lower_power_two(U32 val, U32 max_power_two)
// number of digits, then add one. We subtract 1 initially to handle
// the case where the number passed in is actually a power of two.
// WARNING: this only works with 32 bit ints.
-inline U32 get_next_power_two(U32 val, U32 max_power_two)
+constexpr U32 get_next_power_two(U32 val, U32 max_power_two)
{
if(!max_power_two)
{
@@ -490,7 +457,7 @@ inline U32 get_next_power_two(U32 val, U32 max_power_two)
//get the gaussian value given the linear distance from axis x and guassian value o
inline F32 llgaussian(F32 x, F32 o)
{
- return 1.f/(F_SQRT_TWO_PI*o)*powf(F_E, -(x*x)/(2*o*o));
+ return 1.f/(F_SQRT_TWO_PI*o)*powf(F_E, -(x*x)/(2.f*o*o));
}
//helper function for removing outliers
@@ -543,7 +510,8 @@ inline void ll_remove_outliers(std::vector<VEC_TYPE>& data, F32 k)
// Note: in our code, values labeled as sRGB are ALWAYS gamma corrected linear values, NOT linear values with monitor gamma applied
// Note: stored color values should always be gamma corrected linear (i.e. the values returned from an on-screen color swatch)
// Note: DO NOT cache the conversion. This leads to error prone synchronization and is actually slower in the typical case due to cache misses
-inline float linearTosRGB(const float val) {
+inline float linearTosRGB(const float val)
+{
if (val < 0.0031308f) {
return val * 12.92f;
}
@@ -558,7 +526,8 @@ inline float linearTosRGB(const float val) {
// Note: Stored color values should generally be gamma corrected sRGB.
// If you're serializing the return value of this function, you're probably doing it wrong.
// Note: DO NOT cache the conversion. This leads to error prone synchronization and is actually slower in the typical case due to cache misses.
-inline float sRGBtoLinear(const float val) {
+inline float sRGBtoLinear(const float val)
+{
if (val < 0.04045f) {
return val / 12.92f;
}
diff --git a/indra/llmath/llquaternion.cpp b/indra/llmath/llquaternion.cpp
index aefb82b2f0..3a6748bdb3 100644
--- a/indra/llmath/llquaternion.cpp
+++ b/indra/llmath/llquaternion.cpp
@@ -30,7 +30,6 @@
#include "llquaternion.h"
-//#include "vmath.h"
#include "v3math.h"
#include "v3dmath.h"
#include "v4math.h"
@@ -58,7 +57,7 @@ LLQuaternion::LLQuaternion(const LLMatrix3 &mat)
LLQuaternion::LLQuaternion(F32 angle, const LLVector4 &vec)
{
- F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
+ F32 mag = vec.length();
if (mag > FP_MAG_THRESHOLD)
{
angle *= 0.5;
@@ -77,7 +76,7 @@ LLQuaternion::LLQuaternion(F32 angle, const LLVector4 &vec)
LLQuaternion::LLQuaternion(F32 angle, const LLVector3 &vec)
{
- F32 mag = sqrtf(vec.mV[VX] * vec.mV[VX] + vec.mV[VY] * vec.mV[VY] + vec.mV[VZ] * vec.mV[VZ]);
+ F32 mag = vec.length();
if (mag > FP_MAG_THRESHOLD)
{
angle *= 0.5;
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index 6335da5b62..ca7bd8907b 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -1298,10 +1298,11 @@ void LLPath::genNGon(const LLPathParams& params, S32 sides, F32 startOff, F32 en
c = cos(ang)*lerp(radius_start, radius_end, t);
- pt->mPos.set(0 + lerp(0,params.getShear().mV[0],s)
+ pt->mPos.set(0 + lerp(0.f, params.getShear().mV[VX], s)
+ lerp(-skew ,skew, t) * 0.5f,
- c + lerp(0,params.getShear().mV[1],s),
+ c + lerp(0.f, params.getShear().mV[VY], s),
s);
+
pt->mScale.set(hole_x * lerp(taper_x_begin, taper_x_end, t),
hole_y * lerp(taper_y_begin, taper_y_end, t),
0,1);
@@ -1331,9 +1332,9 @@ void LLPath::genNGon(const LLPathParams& params, S32 sides, F32 startOff, F32 en
c = cos(ang)*lerp(radius_start, radius_end, t);
s = sin(ang)*lerp(radius_start, radius_end, t);
- pt->mPos.set(0 + lerp(0,params.getShear().mV[0],s)
+ pt->mPos.set(0 + lerp(0.f, params.getShear().mV[VX], s)
+ lerp(-skew ,skew, t) * 0.5f,
- c + lerp(0,params.getShear().mV[1],s),
+ c + lerp(0.f, params.getShear().mV[VY], s),
s);
pt->mScale.set(hole_x * lerp(taper_x_begin, taper_x_end, t),
@@ -1358,9 +1359,9 @@ void LLPath::genNGon(const LLPathParams& params, S32 sides, F32 startOff, F32 en
c = cos(ang)*lerp(radius_start, radius_end, t);
s = sin(ang)*lerp(radius_start, radius_end, t);
- pt->mPos.set(0 + lerp(0,params.getShear().mV[0],s)
+ pt->mPos.set(0 + lerp(0.f, params.getShear().mV[VX], s)
+ lerp(-skew ,skew, t) * 0.5f,
- c + lerp(0,params.getShear().mV[1],s),
+ c + lerp(0.f, params.getShear().mV[VY], s),
s);
pt->mScale.set(hole_x * lerp(taper_x_begin, taper_x_end, t),
hole_y * lerp(taper_y_begin, taper_y_end, t),
@@ -1498,8 +1499,8 @@ bool LLPath::generate(const LLPathParams& params, F32 detail, S32 split,
for (S32 i=0;i<np;i++)
{
F32 t = lerp(params.getBegin(),params.getEnd(),(F32)i * mStep);
- mPath[i].mPos.set(lerp(0,params.getShear().mV[0],t),
- lerp(0,params.getShear().mV[1],t),
+ mPath[i].mPos.set(lerp(0.f, params.getShear().mV[VX], t),
+ lerp(0.f ,params.getShear().mV[VY], t),
t - 0.5f);
LLQuaternion quat;
quat.setQuat(lerp(F_PI * params.getTwistBegin(),F_PI * params.getTwist(),t),0,0,1);
@@ -1563,10 +1564,10 @@ bool LLPath::generate(const LLPathParams& params, F32 detail, S32 split,
{
F32 t = (F32)i * mStep;
mPath[i].mPos.set(0,
- lerp(0, -sin(F_PI*params.getTwist()*t)*0.5f,t),
- lerp(-0.5f, cos(F_PI*params.getTwist()*t)*0.5f,t));
- mPath[i].mScale.set(lerp(1,params.getScale().mV[0],t),
- lerp(1,params.getScale().mV[1],t), 0,1);
+ lerp(0.f, -sin(F_PI*params.getTwist() * t) * 0.5f, t),
+ lerp(-0.5f, cos(F_PI*params.getTwist() * t) * 0.5f, t));
+ mPath[i].mScale.set(lerp(1.f, params.getScale().mV[VX], t),
+ lerp(1.f, params.getScale().mV[VY], t), 0.f, 1.f);
mPath[i].mTexT = t;
LLQuaternion quat;
quat.setQuat(F_PI * params.getTwist() * t,1,0,0);
diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h
index 27c5fc5a49..3496928f7b 100644
--- a/indra/llmath/llvolume.h
+++ b/indra/llmath/llvolume.h
@@ -45,7 +45,6 @@ class LLVolumeOctree;
#include "lluuid.h"
#include "v4color.h"
-//#include "vmath.h"
#include "v2math.h"
#include "v3math.h"
#include "v3dmath.h"
diff --git a/indra/llmath/m3math.cpp b/indra/llmath/m3math.cpp
index 472d340af5..3c2097f947 100644
--- a/indra/llmath/m3math.cpp
+++ b/indra/llmath/m3math.cpp
@@ -26,7 +26,6 @@
#include "linden_common.h"
-//#include "vmath.h"
#include "v3math.h"
#include "v3dmath.h"
#include "v4math.h"
diff --git a/indra/llmath/m4math.cpp b/indra/llmath/m4math.cpp
index c46ee587cb..a9853fe7e9 100644
--- a/indra/llmath/m4math.cpp
+++ b/indra/llmath/m4math.cpp
@@ -26,7 +26,6 @@
#include "linden_common.h"
-//#include "vmath.h"
#include "v3math.h"
#include "v4math.h"
#include "m4math.h"
diff --git a/indra/llmath/v2math.cpp b/indra/llmath/v2math.cpp
index 4649e13376..175f08df88 100644
--- a/indra/llmath/v2math.cpp
+++ b/indra/llmath/v2math.cpp
@@ -26,7 +26,6 @@
#include "linden_common.h"
-//#include "vmath.h"
#include "v2math.h"
#include "v3math.h"
#include "v4math.h"
@@ -47,8 +46,8 @@ bool LLVector2::abs()
{
bool ret{ false };
- if (mV[0] < 0.f) { mV[0] = -mV[0]; ret = true; }
- if (mV[1] < 0.f) { mV[1] = -mV[1]; ret = true; }
+ if (mV[VX] < 0.f) { mV[VX] = -mV[VX]; ret = true; }
+ if (mV[VY] < 0.f) { mV[VY] = -mV[VY]; ret = true; }
return ret;
}
@@ -67,14 +66,21 @@ F32 angle_between(const LLVector2& a, const LLVector2& b)
return angle;
}
-bool are_parallel(const LLVector2 &a, const LLVector2 &b, float epsilon)
+F32 signed_angle_between(const LLVector2& a, const LLVector2& b)
+{
+ F32 angle = angle_between(a, b);
+ F32 rhombus_square = a[VX] * b[VY] - b[VX] * a[VY];
+ return rhombus_square < 0 ? -angle : angle;
+}
+
+bool are_parallel(const LLVector2& a, const LLVector2& b, F32 epsilon)
{
LLVector2 an = a;
LLVector2 bn = b;
an.normVec();
bn.normVec();
F32 dot = an * bn;
- if ( (1.0f - fabs(dot)) < epsilon)
+ if ((1.0f - fabs(dot)) < epsilon)
{
return true;
}
@@ -82,28 +88,28 @@ bool are_parallel(const LLVector2 &a, const LLVector2 &b, float epsilon)
}
-F32 dist_vec(const LLVector2 &a, const LLVector2 &b)
+F32 dist_vec(const LLVector2& a, const LLVector2& b)
{
- F32 x = a.mV[0] - b.mV[0];
- F32 y = a.mV[1] - b.mV[1];
+ F32 x = a.mV[VX] - b.mV[VX];
+ F32 y = a.mV[VY] - b.mV[VY];
return (F32) sqrt( x*x + y*y );
}
-F32 dist_vec_squared(const LLVector2 &a, const LLVector2 &b)
+F32 dist_vec_squared(const LLVector2& a, const LLVector2& b)
{
- F32 x = a.mV[0] - b.mV[0];
- F32 y = a.mV[1] - b.mV[1];
+ F32 x = a.mV[VX] - b.mV[VX];
+ F32 y = a.mV[VY] - b.mV[VY];
return x*x + y*y;
}
-F32 dist_vec_squared2D(const LLVector2 &a, const LLVector2 &b)
+F32 dist_vec_squared2D(const LLVector2& a, const LLVector2& b)
{
- F32 x = a.mV[0] - b.mV[0];
- F32 y = a.mV[1] - b.mV[1];
+ F32 x = a.mV[VX] - b.mV[VX];
+ F32 y = a.mV[VY] - b.mV[VY];
return x*x + y*y;
}
-LLVector2 lerp(const LLVector2 &a, const LLVector2 &b, F32 u)
+LLVector2 lerp(const LLVector2& a, const LLVector2& b, F32 u)
{
return LLVector2(
a.mV[VX] + (b.mV[VX] - a.mV[VX]) * u,
@@ -113,14 +119,14 @@ LLVector2 lerp(const LLVector2 &a, const LLVector2 &b, F32 u)
LLSD LLVector2::getValue() const
{
LLSD ret;
- ret[0] = mV[0];
- ret[1] = mV[1];
+ ret[VX] = mV[VX];
+ ret[VY] = mV[VY];
return ret;
}
void LLVector2::setValue(const LLSD& sd)
{
- mV[0] = (F32) sd[0].asReal();
- mV[1] = (F32) sd[1].asReal();
+ mV[VX] = (F32) sd[0].asReal();
+ mV[VY] = (F32) sd[1].asReal();
}
diff --git a/indra/llmath/v2math.h b/indra/llmath/v2math.h
index a61c946304..d9fb70e191 100644
--- a/indra/llmath/v2math.h
+++ b/indra/llmath/v2math.h
@@ -36,7 +36,7 @@ class LLQuaternion;
// Llvector2 = |x y z w|
-static const U32 LENGTHOFVECTOR2 = 2;
+static constexpr U32 LENGTHOFVECTOR2 = 2;
class LLVector2
{
@@ -82,7 +82,7 @@ class LLVector2
const LLVector2& scaleVec(const LLVector2& vec); // scales per component by vec
- bool isNull(); // Returns true if vector has a _very_small_ length
+ bool isNull() const; // Returns true if vector has a _very_small_ length
bool isExactlyZero() const { return !mV[VX] && !mV[VY]; }
F32 operator[](int idx) const { return mV[idx]; }
@@ -107,43 +107,40 @@ class LLVector2
friend LLVector2 operator-(const LLVector2 &a); // Return vector -a
- friend std::ostream& operator<<(std::ostream& s, const LLVector2 &a); // Stream a
+ friend std::ostream& operator<<(std::ostream& s, const LLVector2 &a); // Stream a
};
// Non-member functions
-F32 angle_between(const LLVector2 &a, const LLVector2 &b); // Returns angle (radians) between a and b
-bool are_parallel(const LLVector2 &a, const LLVector2 &b, F32 epsilon=F_APPROXIMATELY_ZERO); // Returns true if a and b are very close to parallel
-F32 dist_vec(const LLVector2 &a, const LLVector2 &b); // Returns distance between a and b
-F32 dist_vec_squared(const LLVector2 &a, const LLVector2 &b);// Returns distance squared between a and b
-F32 dist_vec_squared2D(const LLVector2 &a, const LLVector2 &b);// Returns distance squared between a and b ignoring Z component
-LLVector2 lerp(const LLVector2 &a, const LLVector2 &b, F32 u); // Returns a vector that is a linear interpolation between a and b
+F32 angle_between(const LLVector2& a, const LLVector2& b); // Returns angle (radians) between a and b
+F32 signed_angle_between(const LLVector2& a, const LLVector2& b); // Returns signed angle (radians) between a and b
+bool are_parallel(const LLVector2& a, const LLVector2& b, F32 epsilon = F_APPROXIMATELY_ZERO); // Returns true if a and b are very close to parallel
+F32 dist_vec(const LLVector2& a, const LLVector2& b); // Returns distance between a and b
+F32 dist_vec_squared(const LLVector2& a, const LLVector2& b);// Returns distance squared between a and b
+F32 dist_vec_squared2D(const LLVector2& a, const LLVector2& b);// Returns distance squared between a and b ignoring Z component
+LLVector2 lerp(const LLVector2& a, const LLVector2& b, F32 u); // Returns a vector that is a linear interpolation between a and b
// Constructors
-inline LLVector2::LLVector2(void)
+inline LLVector2::LLVector2()
{
- mV[VX] = 0.f;
- mV[VY] = 0.f;
+ clear();
}
inline LLVector2::LLVector2(F32 x, F32 y)
{
- mV[VX] = x;
- mV[VY] = y;
+ set(x, y);
}
inline LLVector2::LLVector2(const F32 *vec)
{
- mV[VX] = vec[VX];
- mV[VY] = vec[VY];
+ set(vec);
}
inline LLVector2::LLVector2(const LLVector3 &vec)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
+ set(vec.mV);
}
inline LLVector2::LLVector2(const LLSD &sd)
@@ -153,30 +150,26 @@ inline LLVector2::LLVector2(const LLSD &sd)
// Clear and Assignment Functions
-inline void LLVector2::clear(void)
+inline void LLVector2::clear()
{
- mV[VX] = 0.f;
- mV[VY] = 0.f;
+ mV[VX] = mV[VY] = 0.f;
}
-inline void LLVector2::setZero(void)
+inline void LLVector2::setZero()
{
- mV[VX] = 0.f;
- mV[VY] = 0.f;
+ clear();
}
// deprecated
-inline void LLVector2::clearVec(void)
+inline void LLVector2::clearVec()
{
- mV[VX] = 0.f;
- mV[VY] = 0.f;
+ clear();
}
// deprecated
-inline void LLVector2::zeroVec(void)
+inline void LLVector2::zeroVec()
{
- mV[VX] = 0.f;
- mV[VY] = 0.f;
+ clear();
}
inline void LLVector2::set(F32 x, F32 y)
@@ -187,108 +180,84 @@ inline void LLVector2::set(F32 x, F32 y)
inline void LLVector2::set(const LLVector2 &vec)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
+ set(vec.mV);
}
inline void LLVector2::set(const F32 *vec)
{
- mV[VX] = vec[VX];
- mV[VY] = vec[VY];
+ set(vec[VX], vec[VY]);
}
// deprecated
inline void LLVector2::setVec(F32 x, F32 y)
{
- mV[VX] = x;
- mV[VY] = y;
+ set(x, y);
}
// deprecated
inline void LLVector2::setVec(const LLVector2 &vec)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
+ set(vec);
}
// deprecated
inline void LLVector2::setVec(const F32 *vec)
{
- mV[VX] = vec[VX];
- mV[VY] = vec[VY];
+ set(vec);
}
// LLVector2 Magnitude and Normalization Functions
-inline F32 LLVector2::length(void) const
+inline F32 LLVector2::length() const
{
- return (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1]);
+ return sqrt(lengthSquared());
}
-inline F32 LLVector2::lengthSquared(void) const
+inline F32 LLVector2::lengthSquared() const
{
- return mV[0]*mV[0] + mV[1]*mV[1];
+ return mV[VX]*mV[VX] + mV[VY]*mV[VY];
}
-inline F32 LLVector2::normalize(void)
+inline F32 LLVector2::normalize()
{
- F32 mag = (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1]);
- F32 oomag;
+ F32 mag = length();
if (mag > FP_MAG_THRESHOLD)
{
- oomag = 1.f/mag;
- mV[0] *= oomag;
- mV[1] *= oomag;
+ *this /= mag;
}
else
{
- mV[0] = 0.f;
- mV[1] = 0.f;
+ clear();
mag = 0;
}
- return (mag);
+ return mag;
}
// checker
inline bool LLVector2::isFinite() const
{
- return (llfinite(mV[VX]) && llfinite(mV[VY]));
+ return llfinite(mV[VX]) && llfinite(mV[VY]);
}
// deprecated
-inline F32 LLVector2::magVec(void) const
+inline F32 LLVector2::magVec(void) const
{
- return (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1]);
+ return length();
}
// deprecated
-inline F32 LLVector2::magVecSquared(void) const
+inline F32 LLVector2::magVecSquared(void) const
{
- return mV[0]*mV[0] + mV[1]*mV[1];
+ return lengthSquared();
}
// deprecated
-inline F32 LLVector2::normVec(void)
+inline F32 LLVector2::normVec(void)
{
- F32 mag = (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1]);
- F32 oomag;
-
- if (mag > FP_MAG_THRESHOLD)
- {
- oomag = 1.f/mag;
- mV[0] *= oomag;
- mV[1] *= oomag;
- }
- else
- {
- mV[0] = 0.f;
- mV[1] = 0.f;
- mag = 0;
- }
- return (mag);
+ return normalize();
}
inline const LLVector2& LLVector2::scaleVec(const LLVector2& vec)
@@ -299,22 +268,18 @@ inline const LLVector2& LLVector2::scaleVec(const LLVector2& vec)
return *this;
}
-inline bool LLVector2::isNull()
+inline bool LLVector2::isNull() const
{
- if ( F_APPROXIMATELY_ZERO > mV[VX]*mV[VX] + mV[VY]*mV[VY] )
- {
- return true;
- }
- return false;
+ return F_APPROXIMATELY_ZERO > mV[VX]*mV[VX] + mV[VY]*mV[VY];
}
// LLVector2 Operators
// For sorting. By convention, x is "more significant" than y.
-inline bool operator<(const LLVector2 &a, const LLVector2 &b)
+inline bool operator<(const LLVector2& a, const LLVector2& b)
{
- if( a.mV[VX] == b.mV[VX] )
+ if (a.mV[VX] == b.mV[VX])
{
return a.mV[VY] < b.mV[VY];
}
@@ -325,95 +290,92 @@ inline bool operator<(const LLVector2 &a, const LLVector2 &b)
}
-inline LLVector2 operator+(const LLVector2 &a, const LLVector2 &b)
+inline LLVector2 operator+(const LLVector2& a, const LLVector2& b)
{
LLVector2 c(a);
return c += b;
}
-inline LLVector2 operator-(const LLVector2 &a, const LLVector2 &b)
+inline LLVector2 operator-(const LLVector2& a, const LLVector2& b)
{
LLVector2 c(a);
return c -= b;
}
-inline F32 operator*(const LLVector2 &a, const LLVector2 &b)
+inline F32 operator*(const LLVector2& a, const LLVector2& b)
{
- return (a.mV[0]*b.mV[0] + a.mV[1]*b.mV[1]);
+ return (a.mV[VX]*b.mV[VX] + a.mV[VY]*b.mV[VY]);
}
-inline LLVector2 operator%(const LLVector2 &a, const LLVector2 &b)
+inline LLVector2 operator%(const LLVector2& a, const LLVector2& b)
{
- return LLVector2(a.mV[0]*b.mV[1] - b.mV[0]*a.mV[1], a.mV[1]*b.mV[0] - b.mV[1]*a.mV[0]);
+ return LLVector2(a.mV[VX]*b.mV[VY] - b.mV[VX]*a.mV[VY], a.mV[VY]*b.mV[VX] - b.mV[VY]*a.mV[VX]);
}
-inline LLVector2 operator/(const LLVector2 &a, F32 k)
+inline LLVector2 operator/(const LLVector2& a, F32 k)
{
F32 t = 1.f / k;
- return LLVector2( a.mV[0] * t, a.mV[1] * t );
+ return LLVector2( a.mV[VX] * t, a.mV[VY] * t );
}
-inline LLVector2 operator*(const LLVector2 &a, F32 k)
+inline LLVector2 operator*(const LLVector2& a, F32 k)
{
- return LLVector2( a.mV[0] * k, a.mV[1] * k );
+ return LLVector2( a.mV[VX] * k, a.mV[VY] * k );
}
-inline LLVector2 operator*(F32 k, const LLVector2 &a)
+inline LLVector2 operator*(F32 k, const LLVector2& a)
{
- return LLVector2( a.mV[0] * k, a.mV[1] * k );
+ return LLVector2( a.mV[VX] * k, a.mV[VY] * k );
}
-inline bool operator==(const LLVector2 &a, const LLVector2 &b)
+inline bool operator==(const LLVector2& a, const LLVector2& b)
{
- return ( (a.mV[0] == b.mV[0])
- &&(a.mV[1] == b.mV[1]));
+ return ( (a.mV[VX] == b.mV[VX])
+ &&(a.mV[VY] == b.mV[VY]));
}
-inline bool operator!=(const LLVector2 &a, const LLVector2 &b)
+inline bool operator!=(const LLVector2& a, const LLVector2& b)
{
- return ( (a.mV[0] != b.mV[0])
- ||(a.mV[1] != b.mV[1]));
+ return ( (a.mV[VX] != b.mV[VX])
+ ||(a.mV[VY] != b.mV[VY]));
}
-inline const LLVector2& operator+=(LLVector2 &a, const LLVector2 &b)
+inline const LLVector2& operator+=(LLVector2& a, const LLVector2& b)
{
- a.mV[0] += b.mV[0];
- a.mV[1] += b.mV[1];
+ a.mV[VX] += b.mV[VX];
+ a.mV[VY] += b.mV[VY];
return a;
}
-inline const LLVector2& operator-=(LLVector2 &a, const LLVector2 &b)
+inline const LLVector2& operator-=(LLVector2& a, const LLVector2& b)
{
- a.mV[0] -= b.mV[0];
- a.mV[1] -= b.mV[1];
+ a.mV[VX] -= b.mV[VX];
+ a.mV[VY] -= b.mV[VY];
return a;
}
-inline const LLVector2& operator%=(LLVector2 &a, const LLVector2 &b)
+inline const LLVector2& operator%=(LLVector2& a, const LLVector2& b)
{
- LLVector2 ret(a.mV[0]*b.mV[1] - b.mV[0]*a.mV[1], a.mV[1]*b.mV[0] - b.mV[1]*a.mV[0]);
+ LLVector2 ret(a.mV[VX]*b.mV[VY] - b.mV[VX]*a.mV[VY], a.mV[VY]*b.mV[VX] - b.mV[VY]*a.mV[VX]);
a = ret;
return a;
}
-inline const LLVector2& operator*=(LLVector2 &a, F32 k)
+inline const LLVector2& operator*=(LLVector2& a, F32 k)
{
- a.mV[0] *= k;
- a.mV[1] *= k;
+ a.mV[VX] *= k;
+ a.mV[VY] *= k;
return a;
}
-inline const LLVector2& operator/=(LLVector2 &a, F32 k)
+inline const LLVector2& operator/=(LLVector2& a, F32 k)
{
- F32 t = 1.f / k;
- a.mV[0] *= t;
- a.mV[1] *= t;
- return a;
+ return a *= 1.f / k;
}
-inline LLVector2 operator-(const LLVector2 &a)
+inline LLVector2 operator-(const LLVector2& a)
{
- return LLVector2( -a.mV[0], -a.mV[1] );
+ return LLVector2( -a.mV[VX], -a.mV[VY] );
}
inline void update_min_max(LLVector2& min, LLVector2& max, const LLVector2& pos)
@@ -431,7 +393,7 @@ inline void update_min_max(LLVector2& min, LLVector2& max, const LLVector2& pos)
}
}
-inline std::ostream& operator<<(std::ostream& s, const LLVector2 &a)
+inline std::ostream& operator<<(std::ostream& s, const LLVector2& a)
{
s << "{ " << a.mV[VX] << ", " << a.mV[VY] << " }";
return s;
diff --git a/indra/llmath/v3color.cpp b/indra/llmath/v3color.cpp
index 4367b993f8..08b3795020 100644
--- a/indra/llmath/v3color.cpp
+++ b/indra/llmath/v3color.cpp
@@ -32,74 +32,79 @@
LLColor3 LLColor3::white(1.0f, 1.0f, 1.0f);
LLColor3 LLColor3::black(0.0f, 0.0f, 0.0f);
-LLColor3 LLColor3::grey (0.5f, 0.5f, 0.5f);
+LLColor3 LLColor3::grey(0.5f, 0.5f, 0.5f);
-LLColor3::LLColor3(const LLColor4 &a)
+LLColor3::LLColor3(const LLColor4& a)
{
- mV[0] = a.mV[0];
- mV[1] = a.mV[1];
- mV[2] = a.mV[2];
+ mV[VRED] = a.mV[VRED];
+ mV[VGREEN] = a.mV[VGREEN];
+ mV[VBLUE] = a.mV[VBLUE];
}
-LLColor3::LLColor3(const LLVector4 &a)
+LLColor3::LLColor3(const LLVector4& a)
{
- mV[0] = a.mV[0];
- mV[1] = a.mV[1];
- mV[2] = a.mV[2];
+ mV[VRED] = a.mV[VRED];
+ mV[VGREEN] = a.mV[VGREEN];
+ mV[VBLUE] = a.mV[VBLUE];
}
-LLColor3::LLColor3(const LLSD &sd)
+LLColor3::LLColor3(const LLSD& sd)
{
setValue(sd);
}
-const LLColor3& LLColor3::operator=(const LLColor4 &a)
+const LLColor3& LLColor3::operator=(const LLColor4& a)
{
- mV[0] = a.mV[0];
- mV[1] = a.mV[1];
- mV[2] = a.mV[2];
+ mV[VRED] = a.mV[VRED];
+ mV[VGREEN] = a.mV[VGREEN];
+ mV[VBLUE] = a.mV[VBLUE];
return (*this);
}
-std::ostream& operator<<(std::ostream& s, const LLColor3 &a)
+std::ostream& operator<<(std::ostream& s, const LLColor3& a)
{
s << "{ " << a.mV[VRED] << ", " << a.mV[VGREEN] << ", " << a.mV[VBLUE] << " }";
return s;
}
-static F32 hueToRgb ( F32 val1In, F32 val2In, F32 valHUeIn )
+static F32 hueToRgb(F32 val1In, F32 val2In, F32 valHUeIn)
{
- if ( valHUeIn < 0.0f ) valHUeIn += 1.0f;
- if ( valHUeIn > 1.0f ) valHUeIn -= 1.0f;
- if ( ( 6.0f * valHUeIn ) < 1.0f ) return ( val1In + ( val2In - val1In ) * 6.0f * valHUeIn );
- if ( ( 2.0f * valHUeIn ) < 1.0f ) return ( val2In );
- if ( ( 3.0f * valHUeIn ) < 2.0f ) return ( val1In + ( val2In - val1In ) * ( ( 2.0f / 3.0f ) - valHUeIn ) * 6.0f );
- return ( val1In );
+ if (valHUeIn < 0.0f)
+ valHUeIn += 1.0f;
+ if (valHUeIn > 1.0f)
+ valHUeIn -= 1.0f;
+ if ((6.0f * valHUeIn) < 1.0f)
+ return (val1In + (val2In - val1In) * 6.0f * valHUeIn);
+ if ((2.0f * valHUeIn) < 1.0f)
+ return (val2In);
+ if ((3.0f * valHUeIn) < 2.0f)
+ return (val1In + (val2In - val1In) * ((2.0f / 3.0f) - valHUeIn) * 6.0f);
+ return (val1In);
}
-void LLColor3::setHSL ( F32 hValIn, F32 sValIn, F32 lValIn)
+void LLColor3::setHSL(F32 hValIn, F32 sValIn, F32 lValIn)
{
- if ( sValIn < 0.00001f )
+ if (sValIn < 0.00001f)
{
- mV[VRED] = lValIn;
+ mV[VRED] = lValIn;
mV[VGREEN] = lValIn;
- mV[VBLUE] = lValIn;
+ mV[VBLUE] = lValIn;
}
else
{
F32 interVal1;
F32 interVal2;
- if ( lValIn < 0.5f )
- interVal2 = lValIn * ( 1.0f + sValIn );
+ if (lValIn < 0.5f)
+ interVal2 = lValIn * (1.0f + sValIn);
else
- interVal2 = ( lValIn + sValIn ) - ( sValIn * lValIn );
+ interVal2 = (lValIn + sValIn) - (sValIn * lValIn);
interVal1 = 2.0f * lValIn - interVal2;
- mV[VRED] = hueToRgb ( interVal1, interVal2, hValIn + ( 1.f / 3.f ) );
- mV[VGREEN] = hueToRgb ( interVal1, interVal2, hValIn );
- mV[VBLUE] = hueToRgb ( interVal1, interVal2, hValIn - ( 1.f / 3.f ) );
+ mV[VRED] = hueToRgb(interVal1, interVal2, hValIn + (1.f / 3.f));
+ mV[VGREEN] = hueToRgb(interVal1, interVal2, hValIn);
+ mV[VBLUE] = hueToRgb(interVal1, interVal2, hValIn - (1.f / 3.f));
}
}
@@ -109,45 +114,48 @@ void LLColor3::calcHSL(F32* hue, F32* saturation, F32* luminance) const
F32 var_G = mV[VGREEN];
F32 var_B = mV[VBLUE];
- F32 var_Min = ( var_R < ( var_G < var_B ? var_G : var_B ) ? var_R : ( var_G < var_B ? var_G : var_B ) );
- F32 var_Max = ( var_R > ( var_G > var_B ? var_G : var_B ) ? var_R : ( var_G > var_B ? var_G : var_B ) );
+ F32 var_Min = (var_R < (var_G < var_B ? var_G : var_B) ? var_R : (var_G < var_B ? var_G : var_B));
+ F32 var_Max = (var_R > (var_G > var_B ? var_G : var_B) ? var_R : (var_G > var_B ? var_G : var_B));
F32 del_Max = var_Max - var_Min;
- F32 L = ( var_Max + var_Min ) / 2.0f;
+ F32 L = (var_Max + var_Min) / 2.0f;
F32 H = 0.0f;
F32 S = 0.0f;
- if ( del_Max == 0.0f )
+ if (del_Max == 0.0f)
{
- H = 0.0f;
- S = 0.0f;
+ H = 0.0f;
+ S = 0.0f;
}
else
{
- if ( L < 0.5 )
- S = del_Max / ( var_Max + var_Min );
+ if (L < 0.5)
+ S = del_Max / (var_Max + var_Min);
else
- S = del_Max / ( 2.0f - var_Max - var_Min );
+ S = del_Max / (2.0f - var_Max - var_Min);
- F32 del_R = ( ( ( var_Max - var_R ) / 6.0f ) + ( del_Max / 2.0f ) ) / del_Max;
- F32 del_G = ( ( ( var_Max - var_G ) / 6.0f ) + ( del_Max / 2.0f ) ) / del_Max;
- F32 del_B = ( ( ( var_Max - var_B ) / 6.0f ) + ( del_Max / 2.0f ) ) / del_Max;
+ F32 del_R = (((var_Max - var_R) / 6.0f) + (del_Max / 2.0f)) / del_Max;
+ F32 del_G = (((var_Max - var_G) / 6.0f) + (del_Max / 2.0f)) / del_Max;
+ F32 del_B = (((var_Max - var_B) / 6.0f) + (del_Max / 2.0f)) / del_Max;
- if ( var_R >= var_Max )
+ if (var_R >= var_Max)
H = del_B - del_G;
- else
- if ( var_G >= var_Max )
- H = ( 1.0f / 3.0f ) + del_R - del_B;
- else
- if ( var_B >= var_Max )
- H = ( 2.0f / 3.0f ) + del_G - del_R;
-
- if ( H < 0.0f ) H += 1.0f;
- if ( H > 1.0f ) H -= 1.0f;
+ else if (var_G >= var_Max)
+ H = (1.0f / 3.0f) + del_R - del_B;
+ else if (var_B >= var_Max)
+ H = (2.0f / 3.0f) + del_G - del_R;
+
+ if (H < 0.0f)
+ H += 1.0f;
+ if (H > 1.0f)
+ H -= 1.0f;
}
- if (hue) *hue = H;
- if (saturation) *saturation = S;
- if (luminance) *luminance = L;
+ if (hue)
+ *hue = H;
+ if (saturation)
+ *saturation = S;
+ if (luminance)
+ *luminance = L;
}
diff --git a/indra/llmath/v3color.h b/indra/llmath/v3color.h
index f7af469e66..48b36e7c8a 100644
--- a/indra/llmath/v3color.h
+++ b/indra/llmath/v3color.h
@@ -33,12 +33,12 @@ class LLVector4;
#include "llerror.h"
#include "llmath.h"
#include "llsd.h"
-#include "v3math.h" // needed for linearColor3v implemtation below
+#include "v3math.h" // needed for linearColor3v implemtation below
#include <string.h>
// LLColor3 = |r g b|
-static const U32 LENGTHOFCOLOR3 = 3;
+static constexpr U32 LENGTHOFCOLOR3 = 3;
class LLColor3
{
@@ -50,44 +50,43 @@ public:
static LLColor3 grey;
public:
- LLColor3(); // Initializes LLColor3 to (0, 0, 0)
- LLColor3(F32 r, F32 g, F32 b); // Initializes LLColor3 to (r, g, b)
- LLColor3(const F32 *vec); // Initializes LLColor3 to (vec[0]. vec[1], vec[2])
- LLColor3(const char *color_string); // html format color ie "#FFDDEE"
- explicit LLColor3(const LLColor4& color4); // "explicit" to avoid automatic conversion
- explicit LLColor3(const LLVector4& vector4); // "explicit" to avoid automatic conversion
+ LLColor3(); // Initializes LLColor3 to (0, 0, 0)
+ LLColor3(F32 r, F32 g, F32 b); // Initializes LLColor3 to (r, g, b)
+ LLColor3(const F32* vec); // Initializes LLColor3 to (vec[0]. vec[1], vec[2])
+ LLColor3(const char* color_string); // html format color ie "#FFDDEE"
+ explicit LLColor3(const LLColor4& color4); // "explicit" to avoid automatic conversion
+ explicit LLColor3(const LLVector4& vector4); // "explicit" to avoid automatic conversion
LLColor3(const LLSD& sd);
-
LLSD getValue() const
{
LLSD ret;
- ret[0] = mV[0];
- ret[1] = mV[1];
- ret[2] = mV[2];
+ ret[VRED] = mV[VRED];
+ ret[VGREEN] = mV[VGREEN];
+ ret[VBLUE] = mV[VBLUE];
return ret;
}
void setValue(const LLSD& sd)
{
- mV[0] = (F32) sd[0].asReal();;
- mV[1] = (F32) sd[1].asReal();;
- mV[2] = (F32) sd[2].asReal();;
+ mV[VRED] = (F32)sd[VRED].asReal();
+ mV[VGREEN] = (F32)sd[VGREEN].asReal();
+ mV[VBLUE] = (F32)sd[VBLUE].asReal();
}
void setHSL(F32 hue, F32 saturation, F32 luminance);
void calcHSL(F32* hue, F32* saturation, F32* luminance) const;
- const LLColor3& setToBlack(); // Clears LLColor3 to (0, 0, 0)
- const LLColor3& setToWhite(); // Zero LLColor3 to (0, 0, 0)
+ const LLColor3& setToBlack(); // Clears LLColor3 to (0, 0, 0)
+ const LLColor3& setToWhite(); // Zero LLColor3 to (0, 0, 0)
- const LLColor3& setVec(F32 x, F32 y, F32 z); // deprecated
- const LLColor3& setVec(const LLColor3 &vec); // deprecated
- const LLColor3& setVec(const F32 *vec); // deprecated
+ const LLColor3& setVec(F32 x, F32 y, F32 z); // deprecated
+ const LLColor3& setVec(const LLColor3& vec); // deprecated
+ const LLColor3& setVec(const F32* vec); // deprecated
- const LLColor3& set(F32 x, F32 y, F32 z); // Sets LLColor3 to (x, y, z)
- const LLColor3& set(const LLColor3 &vec); // Sets LLColor3 to vec
- const LLColor3& set(const F32 *vec); // Sets LLColor3 to vec
+ const LLColor3& set(F32 x, F32 y, F32 z); // Sets LLColor3 to (x, y, z)
+ const LLColor3& set(const LLColor3& vec); // Sets LLColor3 to vec
+ const LLColor3& set(const F32* vec); // Sets LLColor3 to vec
// set from a vector of unknown type and size
// may leave some data unmodified
@@ -99,414 +98,390 @@ public:
template<typename T>
void write(std::vector<T>& v) const;
- F32 magVec() const; // deprecated
- F32 magVecSquared() const; // deprecated
- F32 normVec(); // deprecated
+ F32 magVec() const; // deprecated
+ F32 magVecSquared() const; // deprecated
+ F32 normVec(); // deprecated
- F32 length() const; // Returns magnitude of LLColor3
- F32 lengthSquared() const; // Returns magnitude squared of LLColor3
- F32 normalize(); // Normalizes and returns the magnitude of LLColor3
+ F32 length() const; // Returns magnitude of LLColor3
+ F32 lengthSquared() const; // Returns magnitude squared of LLColor3
+ F32 normalize(); // Normalizes and returns the magnitude of LLColor3
- F32 brightness() const; // Returns brightness of LLColor3
+ F32 brightness() const; // Returns brightness of LLColor3
- const LLColor3& operator=(const LLColor4 &a);
+ const LLColor3& operator=(const LLColor4& a);
- LL_FORCE_INLINE LLColor3 divide(const LLColor3 &col2)
+ LL_FORCE_INLINE LLColor3 divide(const LLColor3& col2) const
{
- return LLColor3(
- mV[0] / col2.mV[0],
- mV[1] / col2.mV[1],
- mV[2] / col2.mV[2] );
+ return LLColor3(mV[VRED] / col2.mV[VRED], mV[VGREEN] / col2.mV[VGREEN], mV[VBLUE] / col2.mV[VBLUE]);
}
- LL_FORCE_INLINE LLColor3 color_norm()
+ LL_FORCE_INLINE LLColor3 color_norm() const
{
F32 l = length();
- return LLColor3(
- mV[0] / l,
- mV[1] / l,
- mV[2] / l );
+ return LLColor3(mV[VRED] / l, mV[VGREEN] / l, mV[VBLUE] / l);
}
- friend std::ostream& operator<<(std::ostream& s, const LLColor3 &a); // Print a
- friend LLColor3 operator+(const LLColor3 &a, const LLColor3 &b); // Return vector a + b
- friend LLColor3 operator-(const LLColor3 &a, const LLColor3 &b); // Return vector a minus b
+ friend std::ostream& operator<<(std::ostream& s, const LLColor3& a); // Print a
+ friend LLColor3 operator+(const LLColor3& a, const LLColor3& b); // Return vector a + b
+ friend LLColor3 operator-(const LLColor3& a, const LLColor3& b); // Return vector a minus b
- friend const LLColor3& operator+=(LLColor3 &a, const LLColor3 &b); // Return vector a + b
- friend const LLColor3& operator-=(LLColor3 &a, const LLColor3 &b); // Return vector a minus b
- friend const LLColor3& operator*=(LLColor3 &a, const LLColor3 &b);
+ friend const LLColor3& operator+=(LLColor3& a, const LLColor3& b); // Return vector a + b
+ friend const LLColor3& operator-=(LLColor3& a, const LLColor3& b); // Return vector a minus b
+ friend const LLColor3& operator*=(LLColor3& a, const LLColor3& b);
- friend LLColor3 operator*(const LLColor3 &a, const LLColor3 &b); // Return component wise a * b
- friend LLColor3 operator*(const LLColor3 &a, F32 k); // Return a times scaler k
- friend LLColor3 operator*(F32 k, const LLColor3 &a); // Return a times scaler k
+ friend LLColor3 operator*(const LLColor3& a, const LLColor3& b); // Return component wise a * b
+ friend LLColor3 operator*(const LLColor3& a, F32 k); // Return a times scaler k
+ friend LLColor3 operator*(F32 k, const LLColor3& a); // Return a times scaler k
- friend bool operator==(const LLColor3 &a, const LLColor3 &b); // Return a == b
- friend bool operator!=(const LLColor3 &a, const LLColor3 &b); // Return a != b
+ friend bool operator==(const LLColor3& a, const LLColor3& b); // Return a == b
+ friend bool operator!=(const LLColor3& a, const LLColor3& b); // Return a != b
- friend const LLColor3& operator*=(LLColor3 &a, F32 k); // Return a times scaler k
+ friend const LLColor3& operator*=(LLColor3& a, F32 k); // Return a times scaler k
- friend LLColor3 operator-(const LLColor3 &a); // Return vector 1-rgb (inverse)
+ friend LLColor3 operator-(const LLColor3& a); // Return vector 1-rgb (inverse)
inline void clamp();
- inline void exp(); // Do an exponential on the color
+ inline void exp(); // Do an exponential on the color
};
-LLColor3 lerp(const LLColor3 &a, const LLColor3 &b, F32 u);
-
+LLColor3 lerp(const LLColor3& a, const LLColor3& b, F32 u);
void LLColor3::clamp()
{
// Clamp the color...
- if (mV[0] < 0.f)
+ if (mV[VRED] < 0.f)
{
- mV[0] = 0.f;
+ mV[VRED] = 0.f;
}
- else if (mV[0] > 1.f)
+ else if (mV[VRED] > 1.f)
{
- mV[0] = 1.f;
+ mV[VRED] = 1.f;
}
- if (mV[1] < 0.f)
+ if (mV[VGREEN] < 0.f)
{
- mV[1] = 0.f;
+ mV[VGREEN] = 0.f;
}
- else if (mV[1] > 1.f)
+ else if (mV[VGREEN] > 1.f)
{
- mV[1] = 1.f;
+ mV[VGREEN] = 1.f;
}
- if (mV[2] < 0.f)
+ if (mV[VBLUE] < 0.f)
{
- mV[2] = 0.f;
+ mV[VBLUE] = 0.f;
}
- else if (mV[2] > 1.f)
+ else if (mV[VBLUE] > 1.f)
{
- mV[2] = 1.f;
+ mV[VBLUE] = 1.f;
}
}
// Non-member functions
-F32 distVec(const LLColor3 &a, const LLColor3 &b); // Returns distance between a and b
-F32 distVec_squared(const LLColor3 &a, const LLColor3 &b);// Returns distance squared between a and b
+F32 distVec(const LLColor3& a, const LLColor3& b); // Returns distance between a and b
+F32 distVec_squared(const LLColor3& a, const LLColor3& b); // Returns distance squared between a and b
-inline LLColor3::LLColor3(void)
+inline LLColor3::LLColor3()
{
- mV[0] = 0.f;
- mV[1] = 0.f;
- mV[2] = 0.f;
+ mV[VRED] = 0.f;
+ mV[VGREEN] = 0.f;
+ mV[VBLUE] = 0.f;
}
inline LLColor3::LLColor3(F32 r, F32 g, F32 b)
{
- mV[VRED] = r;
+ mV[VRED] = r;
mV[VGREEN] = g;
- mV[VBLUE] = b;
+ mV[VBLUE] = b;
}
-
-inline LLColor3::LLColor3(const F32 *vec)
+inline LLColor3::LLColor3(const F32* vec)
{
- mV[VRED] = vec[VRED];
+ mV[VRED] = vec[VRED];
mV[VGREEN] = vec[VGREEN];
- mV[VBLUE] = vec[VBLUE];
+ mV[VBLUE] = vec[VBLUE];
}
inline LLColor3::LLColor3(const char* color_string) // takes a string of format "RRGGBB" where RR is hex 00..FF
{
- if (strlen(color_string) < 6) /* Flawfinder: ignore */
+ if (strlen(color_string) < 6) /* Flawfinder: ignore */
{
- mV[0] = 0.f;
- mV[1] = 0.f;
- mV[2] = 0.f;
+ mV[VRED] = 0.f;
+ mV[VGREEN] = 0.f;
+ mV[VBLUE] = 0.f;
return;
}
char tempstr[7];
- strncpy(tempstr,color_string,6); /* Flawfinder: ignore */
+ strncpy(tempstr, color_string, 6); /* Flawfinder: ignore */
tempstr[6] = '\0';
- mV[VBLUE] = (F32)strtol(&tempstr[4],NULL,16)/255.f;
+ mV[VBLUE] = (F32)strtol(&tempstr[4], nullptr, 16) / 255.f;
tempstr[4] = '\0';
- mV[VGREEN] = (F32)strtol(&tempstr[2],NULL,16)/255.f;
+ mV[VGREEN] = (F32)strtol(&tempstr[2], nullptr, 16) / 255.f;
tempstr[2] = '\0';
- mV[VRED] = (F32)strtol(&tempstr[0],NULL,16)/255.f;
+ mV[VRED] = (F32)strtol(&tempstr[0], nullptr, 16) / 255.f;
}
-inline const LLColor3& LLColor3::setToBlack(void)
+inline const LLColor3& LLColor3::setToBlack()
{
- mV[0] = 0.f;
- mV[1] = 0.f;
- mV[2] = 0.f;
+ mV[VRED] = 0.f;
+ mV[VGREEN] = 0.f;
+ mV[VBLUE] = 0.f;
return (*this);
}
-inline const LLColor3& LLColor3::setToWhite(void)
+inline const LLColor3& LLColor3::setToWhite()
{
- mV[0] = 1.f;
- mV[1] = 1.f;
- mV[2] = 1.f;
+ mV[VRED] = 1.f;
+ mV[VGREEN] = 1.f;
+ mV[VBLUE] = 1.f;
return (*this);
}
-inline const LLColor3& LLColor3::set(F32 r, F32 g, F32 b)
+inline const LLColor3& LLColor3::set(F32 r, F32 g, F32 b)
{
- mV[0] = r;
- mV[1] = g;
- mV[2] = b;
+ mV[VRED] = r;
+ mV[VGREEN] = g;
+ mV[VBLUE] = b;
return (*this);
}
-inline const LLColor3& LLColor3::set(const LLColor3 &vec)
+inline const LLColor3& LLColor3::set(const LLColor3& vec)
{
- mV[0] = vec.mV[0];
- mV[1] = vec.mV[1];
- mV[2] = vec.mV[2];
+ mV[VRED] = vec.mV[VRED];
+ mV[VGREEN] = vec.mV[VGREEN];
+ mV[VBLUE] = vec.mV[VBLUE];
return (*this);
}
-inline const LLColor3& LLColor3::set(const F32 *vec)
+inline const LLColor3& LLColor3::set(const F32* vec)
{
- mV[0] = vec[0];
- mV[1] = vec[1];
- mV[2] = vec[2];
+ mV[VRED] = vec[VRED];
+ mV[VGREEN] = vec[VGREEN];
+ mV[VBLUE] = vec[VBLUE];
return (*this);
}
// deprecated
-inline const LLColor3& LLColor3::setVec(F32 r, F32 g, F32 b)
+inline const LLColor3& LLColor3::setVec(F32 r, F32 g, F32 b)
{
- mV[0] = r;
- mV[1] = g;
- mV[2] = b;
+ mV[VRED] = r;
+ mV[VGREEN] = g;
+ mV[VBLUE] = b;
return (*this);
}
// deprecated
-inline const LLColor3& LLColor3::setVec(const LLColor3 &vec)
+inline const LLColor3& LLColor3::setVec(const LLColor3& vec)
{
- mV[0] = vec.mV[0];
- mV[1] = vec.mV[1];
- mV[2] = vec.mV[2];
+ mV[VRED] = vec.mV[VRED];
+ mV[VGREEN] = vec.mV[VGREEN];
+ mV[VBLUE] = vec.mV[VBLUE];
return (*this);
}
// deprecated
-inline const LLColor3& LLColor3::setVec(const F32 *vec)
+inline const LLColor3& LLColor3::setVec(const F32* vec)
{
- mV[0] = vec[0];
- mV[1] = vec[1];
- mV[2] = vec[2];
+ mV[VRED] = vec[VRED];
+ mV[VGREEN] = vec[VGREEN];
+ mV[VBLUE] = vec[VBLUE];
return (*this);
}
-inline F32 LLColor3::brightness(void) const
+inline F32 LLColor3::brightness() const
{
- return (mV[0] + mV[1] + mV[2]) / 3.0f;
+ return (mV[VRED] + mV[VGREEN] + mV[VBLUE]) / 3.0f;
}
-inline F32 LLColor3::length(void) const
+inline F32 LLColor3::length() const
{
- return (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]);
+ return sqrt(mV[VRED] * mV[VRED] + mV[VGREEN] * mV[VGREEN] + mV[VBLUE] * mV[VBLUE]);
}
-inline F32 LLColor3::lengthSquared(void) const
+inline F32 LLColor3::lengthSquared() const
{
- return mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2];
+ return mV[VRED] * mV[VRED] + mV[VGREEN] * mV[VGREEN] + mV[VBLUE] * mV[VBLUE];
}
-inline F32 LLColor3::normalize(void)
+inline F32 LLColor3::normalize()
{
- F32 mag = (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]);
+ F32 mag = sqrt(mV[VRED] * mV[VRED] + mV[VGREEN] * mV[VGREEN] + mV[VBLUE] * mV[VBLUE]);
F32 oomag;
if (mag)
{
- oomag = 1.f/mag;
- mV[0] *= oomag;
- mV[1] *= oomag;
- mV[2] *= oomag;
+ oomag = 1.f / mag;
+ mV[VRED] *= oomag;
+ mV[VGREEN] *= oomag;
+ mV[VBLUE] *= oomag;
}
- return (mag);
+ return mag;
}
// deprecated
-inline F32 LLColor3::magVec(void) const
+inline F32 LLColor3::magVec() const
{
- return (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]);
+ return sqrt(mV[VRED] * mV[VRED] + mV[VGREEN] * mV[VGREEN] + mV[VBLUE] * mV[VBLUE]);
}
// deprecated
-inline F32 LLColor3::magVecSquared(void) const
+inline F32 LLColor3::magVecSquared() const
{
- return mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2];
+ return mV[VRED] * mV[VRED] + mV[VGREEN] * mV[VGREEN] + mV[VBLUE] * mV[VBLUE];
}
// deprecated
-inline F32 LLColor3::normVec(void)
+inline F32 LLColor3::normVec()
{
- F32 mag = (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]);
+ F32 mag = sqrt(mV[VRED] * mV[VRED] + mV[VGREEN] * mV[VGREEN] + mV[VBLUE] * mV[VBLUE]);
F32 oomag;
if (mag)
{
- oomag = 1.f/mag;
- mV[0] *= oomag;
- mV[1] *= oomag;
- mV[2] *= oomag;
+ oomag = 1.f / mag;
+ mV[VRED] *= oomag;
+ mV[VGREEN] *= oomag;
+ mV[VBLUE] *= oomag;
}
- return (mag);
+ return mag;
}
inline void LLColor3::exp()
{
#if 0
- mV[0] = ::exp(mV[0]);
- mV[1] = ::exp(mV[1]);
- mV[2] = ::exp(mV[2]);
+ mV[VRED] = ::exp(mV[VRED]);
+ mV[VGREEN] = ::exp(mV[VGREEN]);
+ mV[VBLUE] = ::exp(mV[VBLUE]);
#else
- mV[0] = (F32)LL_FAST_EXP(mV[0]);
- mV[1] = (F32)LL_FAST_EXP(mV[1]);
- mV[2] = (F32)LL_FAST_EXP(mV[2]);
+ mV[VRED] = (F32)LL_FAST_EXP(mV[VRED]);
+ mV[VGREEN] = (F32)LL_FAST_EXP(mV[VGREEN]);
+ mV[VBLUE] = (F32)LL_FAST_EXP(mV[VBLUE]);
#endif
}
-
-inline LLColor3 operator+(const LLColor3 &a, const LLColor3 &b)
+inline LLColor3 operator+(const LLColor3& a, const LLColor3& b)
{
- return LLColor3(
- a.mV[0] + b.mV[0],
- a.mV[1] + b.mV[1],
- a.mV[2] + b.mV[2]);
+ return LLColor3(a.mV[VRED] + b.mV[VRED], a.mV[VGREEN] + b.mV[VGREEN], a.mV[VBLUE] + b.mV[VBLUE]);
}
-inline LLColor3 operator-(const LLColor3 &a, const LLColor3 &b)
+inline LLColor3 operator-(const LLColor3& a, const LLColor3& b)
{
- return LLColor3(
- a.mV[0] - b.mV[0],
- a.mV[1] - b.mV[1],
- a.mV[2] - b.mV[2]);
+ return LLColor3(a.mV[VRED] - b.mV[VRED], a.mV[VGREEN] - b.mV[VGREEN], a.mV[VBLUE] - b.mV[VBLUE]);
}
-inline LLColor3 operator*(const LLColor3 &a, const LLColor3 &b)
+inline LLColor3 operator*(const LLColor3& a, const LLColor3& b)
{
- return LLColor3(
- a.mV[0] * b.mV[0],
- a.mV[1] * b.mV[1],
- a.mV[2] * b.mV[2]);
+ return LLColor3(a.mV[VRED] * b.mV[VRED], a.mV[VGREEN] * b.mV[VGREEN], a.mV[VBLUE] * b.mV[VBLUE]);
}
-inline LLColor3 operator*(const LLColor3 &a, F32 k)
+inline LLColor3 operator*(const LLColor3& a, F32 k)
{
- return LLColor3( a.mV[0] * k, a.mV[1] * k, a.mV[2] * k );
+ return LLColor3(a.mV[VRED] * k, a.mV[VGREEN] * k, a.mV[VBLUE] * k);
}
-inline LLColor3 operator*(F32 k, const LLColor3 &a)
+inline LLColor3 operator*(F32 k, const LLColor3& a)
{
- return LLColor3( a.mV[0] * k, a.mV[1] * k, a.mV[2] * k );
+ return LLColor3(a.mV[VRED] * k, a.mV[VGREEN] * k, a.mV[VBLUE] * k);
}
-inline bool operator==(const LLColor3 &a, const LLColor3 &b)
+inline bool operator==(const LLColor3& a, const LLColor3& b)
{
- return ( (a.mV[0] == b.mV[0])
- &&(a.mV[1] == b.mV[1])
- &&(a.mV[2] == b.mV[2]));
+ return ((a.mV[VRED] == b.mV[VRED]) && (a.mV[VGREEN] == b.mV[VGREEN]) && (a.mV[VBLUE] == b.mV[VBLUE]));
}
-inline bool operator!=(const LLColor3 &a, const LLColor3 &b)
+inline bool operator!=(const LLColor3& a, const LLColor3& b)
{
- return ( (a.mV[0] != b.mV[0])
- ||(a.mV[1] != b.mV[1])
- ||(a.mV[2] != b.mV[2]));
+ return ((a.mV[VRED] != b.mV[VRED]) || (a.mV[VGREEN] != b.mV[VGREEN]) || (a.mV[VBLUE] != b.mV[VBLUE]));
}
-inline const LLColor3 &operator*=(LLColor3 &a, const LLColor3 &b)
+inline const LLColor3& operator*=(LLColor3& a, const LLColor3& b)
{
- a.mV[0] *= b.mV[0];
- a.mV[1] *= b.mV[1];
- a.mV[2] *= b.mV[2];
+ a.mV[VRED] *= b.mV[VRED];
+ a.mV[VGREEN] *= b.mV[VGREEN];
+ a.mV[VBLUE] *= b.mV[VBLUE];
return a;
}
-inline const LLColor3& operator+=(LLColor3 &a, const LLColor3 &b)
+inline const LLColor3& operator+=(LLColor3& a, const LLColor3& b)
{
- a.mV[0] += b.mV[0];
- a.mV[1] += b.mV[1];
- a.mV[2] += b.mV[2];
+ a.mV[VRED] += b.mV[VRED];
+ a.mV[VGREEN] += b.mV[VGREEN];
+ a.mV[VBLUE] += b.mV[VBLUE];
return a;
}
-inline const LLColor3& operator-=(LLColor3 &a, const LLColor3 &b)
+inline const LLColor3& operator-=(LLColor3& a, const LLColor3& b)
{
- a.mV[0] -= b.mV[0];
- a.mV[1] -= b.mV[1];
- a.mV[2] -= b.mV[2];
+ a.mV[VRED] -= b.mV[VRED];
+ a.mV[VGREEN] -= b.mV[VGREEN];
+ a.mV[VBLUE] -= b.mV[VBLUE];
return a;
}
-inline const LLColor3& operator*=(LLColor3 &a, F32 k)
+inline const LLColor3& operator*=(LLColor3& a, F32 k)
{
- a.mV[0] *= k;
- a.mV[1] *= k;
- a.mV[2] *= k;
+ a.mV[VRED] *= k;
+ a.mV[VGREEN] *= k;
+ a.mV[VBLUE] *= k;
return a;
}
-inline LLColor3 operator-(const LLColor3 &a)
+inline LLColor3 operator-(const LLColor3& a)
{
- return LLColor3(
- 1.f - a.mV[0],
- 1.f - a.mV[1],
- 1.f - a.mV[2] );
+ return LLColor3(1.f - a.mV[VRED], 1.f - a.mV[VGREEN], 1.f - a.mV[VBLUE]);
}
// Non-member functions
-inline F32 distVec(const LLColor3 &a, const LLColor3 &b)
+inline F32 distVec(const LLColor3& a, const LLColor3& b)
{
- F32 x = a.mV[0] - b.mV[0];
- F32 y = a.mV[1] - b.mV[1];
- F32 z = a.mV[2] - b.mV[2];
- return (F32) sqrt( x*x + y*y + z*z );
+ F32 x = a.mV[VRED] - b.mV[VRED];
+ F32 y = a.mV[VGREEN] - b.mV[VGREEN];
+ F32 z = a.mV[VBLUE] - b.mV[VBLUE];
+ return sqrt(x * x + y * y + z * z);
}
-inline F32 distVec_squared(const LLColor3 &a, const LLColor3 &b)
+inline F32 distVec_squared(const LLColor3& a, const LLColor3& b)
{
- F32 x = a.mV[0] - b.mV[0];
- F32 y = a.mV[1] - b.mV[1];
- F32 z = a.mV[2] - b.mV[2];
- return x*x + y*y + z*z;
+ F32 x = a.mV[VRED] - b.mV[VRED];
+ F32 y = a.mV[VGREEN] - b.mV[VGREEN];
+ F32 z = a.mV[VBLUE] - b.mV[VBLUE];
+ return x * x + y * y + z * z;
}
-inline LLColor3 lerp(const LLColor3 &a, const LLColor3 &b, F32 u)
+inline LLColor3 lerp(const LLColor3& a, const LLColor3& b, F32 u)
{
- return LLColor3(
- a.mV[VX] + (b.mV[VX] - a.mV[VX]) * u,
- a.mV[VY] + (b.mV[VY] - a.mV[VY]) * u,
- a.mV[VZ] + (b.mV[VZ] - a.mV[VZ]) * u);
+ return LLColor3(a.mV[VX] + (b.mV[VX] - a.mV[VX]) * u, a.mV[VY] + (b.mV[VY] - a.mV[VY]) * u, a.mV[VZ] + (b.mV[VZ] - a.mV[VZ]) * u);
}
-inline const LLColor3 srgbColor3(const LLColor3 &a) {
+inline const LLColor3 srgbColor3(const LLColor3& a)
+{
LLColor3 srgbColor;
- srgbColor.mV[0] = linearTosRGB(a.mV[0]);
- srgbColor.mV[1] = linearTosRGB(a.mV[1]);
- srgbColor.mV[2] = linearTosRGB(a.mV[2]);
+ srgbColor.mV[VRED] = linearTosRGB(a.mV[VRED]);
+ srgbColor.mV[VGREEN] = linearTosRGB(a.mV[VGREEN]);
+ srgbColor.mV[VBLUE] = linearTosRGB(a.mV[VBLUE]);
return srgbColor;
}
-inline const LLColor3 linearColor3p(const F32* v) {
+inline const LLColor3 linearColor3p(const F32* v)
+{
LLColor3 linearColor;
- linearColor.mV[0] = sRGBtoLinear(v[0]);
- linearColor.mV[1] = sRGBtoLinear(v[1]);
- linearColor.mV[2] = sRGBtoLinear(v[2]);
+ linearColor.mV[VRED] = sRGBtoLinear(v[VRED]);
+ linearColor.mV[VGREEN] = sRGBtoLinear(v[VGREEN]);
+ linearColor.mV[VBLUE] = sRGBtoLinear(v[VBLUE]);
return linearColor;
}
template<class T>
-inline const LLColor3 linearColor3(const T& a) {
+inline const LLColor3 linearColor3(const T& a)
+{
return linearColor3p(a.mV);
}
template<class T>
-inline const LLVector3 linearColor3v(const T& a) {
+inline const LLVector3 linearColor3v(const T& a)
+{
return LLVector3(linearColor3p(a.mV).mV);
}
diff --git a/indra/llmath/v3colorutil.h b/indra/llmath/v3colorutil.h
index af8799e42a..4dc3100443 100644
--- a/indra/llmath/v3colorutil.h
+++ b/indra/llmath/v3colorutil.h
@@ -30,59 +30,46 @@
#include "v3color.h"
#include "v4color.h"
-inline LLColor3 componentDiv(LLColor3 const &left, LLColor3 const & right)
+inline LLColor3 componentDiv(const LLColor3& left, const LLColor3& right)
{
- return LLColor3(left.mV[0] / right.mV[0],
- left.mV[1] / right.mV[1],
- left.mV[2] / right.mV[2]);
+ return LLColor3(left.mV[VRED] / right.mV[VRED], left.mV[VGREEN] / right.mV[VGREEN], left.mV[VBLUE] / right.mV[VBLUE]);
}
-
-inline LLColor3 componentMult(LLColor3 const &left, LLColor3 const & right)
+inline LLColor3 componentMult(const LLColor3& left, const LLColor3& right)
{
- return LLColor3(left.mV[0] * right.mV[0],
- left.mV[1] * right.mV[1],
- left.mV[2] * right.mV[2]);
+ return LLColor3(left.mV[VRED] * right.mV[VRED], left.mV[VGREEN] * right.mV[VGREEN], left.mV[VBLUE] * right.mV[VBLUE]);
}
-
-inline LLColor3 componentExp(LLColor3 const &v)
+inline LLColor3 componentExp(const LLColor3& v)
{
- return LLColor3(exp(v.mV[0]),
- exp(v.mV[1]),
- exp(v.mV[2]));
+ return LLColor3(exp(v.mV[VRED]), exp(v.mV[VGREEN]), exp(v.mV[VBLUE]));
}
-inline LLColor3 componentPow(LLColor3 const &v, F32 exponent)
+inline LLColor3 componentPow(const LLColor3& v, F32 exponent)
{
- return LLColor3(pow(v.mV[0], exponent),
- pow(v.mV[1], exponent),
- pow(v.mV[2], exponent));
+ return LLColor3(pow(v.mV[VRED], exponent), pow(v.mV[VGREEN], exponent), pow(v.mV[VBLUE], exponent));
}
-inline LLColor3 componentSaturate(LLColor3 const &v)
+inline LLColor3 componentSaturate(const LLColor3& v)
{
- return LLColor3(std::max(std::min(v.mV[0], 1.f), 0.f),
- std::max(std::min(v.mV[1], 1.f), 0.f),
- std::max(std::min(v.mV[2], 1.f), 0.f));
+ return LLColor3(std::max(std::min(v.mV[VRED], 1.f), 0.f),
+ std::max(std::min(v.mV[VGREEN], 1.f), 0.f),
+ std::max(std::min(v.mV[VBLUE], 1.f), 0.f));
}
-
-inline LLColor3 componentSqrt(LLColor3 const &v)
+inline LLColor3 componentSqrt(const LLColor3& v)
{
- return LLColor3(sqrt(v.mV[0]),
- sqrt(v.mV[1]),
- sqrt(v.mV[2]));
+ return LLColor3(sqrt(v.mV[VRED]), sqrt(v.mV[VGREEN]), sqrt(v.mV[VBLUE]));
}
-inline void componentMultBy(LLColor3 & left, LLColor3 const & right)
+inline void componentMultBy(LLColor3& left, const LLColor3& right)
{
- left.mV[0] *= right.mV[0];
- left.mV[1] *= right.mV[1];
- left.mV[2] *= right.mV[2];
+ left.mV[VRED] *= right.mV[VRED];
+ left.mV[VGREEN] *= right.mV[VGREEN];
+ left.mV[VBLUE] *= right.mV[VBLUE];
}
-inline LLColor3 colorMix(LLColor3 const & left, LLColor3 const & right, F32 amount)
+inline LLColor3 colorMix(const LLColor3& left, const LLColor3& right, F32 amount)
{
return (left + ((right - left) * amount));
}
@@ -92,25 +79,24 @@ inline LLColor3 smear(F32 val)
return LLColor3(val, val, val);
}
-inline F32 color_intens(const LLColor3 &col)
+inline F32 color_intens(const LLColor3& col)
{
- return col.mV[0] + col.mV[1] + col.mV[2];
+ return col.mV[VRED] + col.mV[VGREEN] + col.mV[VBLUE];
}
-inline F32 color_max(const LLColor3 &col)
+inline F32 color_max(const LLColor3& col)
{
- return llmax(col.mV[0], col.mV[1], col.mV[2]);
+ return llmax(col.mV[VRED], col.mV[VGREEN], col.mV[VBLUE]);
}
-inline F32 color_max(const LLColor4 &col)
+inline F32 color_max(const LLColor4& col)
{
- return llmax(col.mV[0], col.mV[1], col.mV[2]);
+ return llmax(col.mV[VRED], col.mV[VGREEN], col.mV[VBLUE]);
}
-
-inline F32 color_min(const LLColor3 &col)
+inline F32 color_min(const LLColor3& col)
{
- return llmin(col.mV[0], col.mV[1], col.mV[2]);
+ return llmin(col.mV[VRED], col.mV[VGREEN], col.mV[VBLUE]);
}
#endif
diff --git a/indra/llmath/v3dmath.cpp b/indra/llmath/v3dmath.cpp
index bb55c812b5..b051303686 100644
--- a/indra/llmath/v3dmath.cpp
+++ b/indra/llmath/v3dmath.cpp
@@ -30,7 +30,6 @@
#include "v3dmath.h"
-//#include "vmath.h"
#include "v4math.h"
#include "m4math.h"
#include "m3math.h"
@@ -57,13 +56,13 @@ bool LLVector3d::clamp(F64 min, F64 max)
{
bool ret{ false };
- if (mdV[0] < min) { mdV[0] = min; ret = true; }
- if (mdV[1] < min) { mdV[1] = min; ret = true; }
- if (mdV[2] < min) { mdV[2] = min; ret = true; }
+ if (mdV[VX] < min) { mdV[VX] = min; ret = true; }
+ if (mdV[VY] < min) { mdV[VY] = min; ret = true; }
+ if (mdV[VZ] < min) { mdV[VZ] = min; ret = true; }
- if (mdV[0] > max) { mdV[0] = max; ret = true; }
- if (mdV[1] > max) { mdV[1] = max; ret = true; }
- if (mdV[2] > max) { mdV[2] = max; ret = true; }
+ if (mdV[VX] > max) { mdV[VX] = max; ret = true; }
+ if (mdV[VY] > max) { mdV[VY] = max; ret = true; }
+ if (mdV[VZ] > max) { mdV[VZ] = max; ret = true; }
return ret;
}
@@ -74,9 +73,9 @@ bool LLVector3d::abs()
{
bool ret{ false };
- if (mdV[0] < 0.0) { mdV[0] = -mdV[0]; ret = true; }
- if (mdV[1] < 0.0) { mdV[1] = -mdV[1]; ret = true; }
- if (mdV[2] < 0.0) { mdV[2] = -mdV[2]; ret = true; }
+ if (mdV[VX] < 0.0) { mdV[VX] = -mdV[VX]; ret = true; }
+ if (mdV[VY] < 0.0) { mdV[VY] = -mdV[VY]; ret = true; }
+ if (mdV[VZ] < 0.0) { mdV[VZ] = -mdV[VZ]; ret = true; }
return ret;
}
@@ -89,37 +88,37 @@ std::ostream& operator<<(std::ostream& s, const LLVector3d &a)
const LLVector3d& LLVector3d::operator=(const LLVector4 &a)
{
- mdV[0] = a.mV[0];
- mdV[1] = a.mV[1];
- mdV[2] = a.mV[2];
+ mdV[VX] = a.mV[VX];
+ mdV[VY] = a.mV[VY];
+ mdV[VZ] = a.mV[VZ];
return *this;
}
-const LLVector3d& LLVector3d::rotVec(const LLMatrix3 &mat)
+const LLVector3d& LLVector3d::rotVec(const LLMatrix3& mat)
{
*this = *this * mat;
return *this;
}
-const LLVector3d& LLVector3d::rotVec(const LLQuaternion &q)
+const LLVector3d& LLVector3d::rotVec(const LLQuaternion& q)
{
*this = *this * q;
return *this;
}
-const LLVector3d& LLVector3d::rotVec(F64 angle, const LLVector3d &vec)
+const LLVector3d& LLVector3d::rotVec(F64 angle, const LLVector3d& vec)
{
- if ( !vec.isExactlyZero() && angle )
+ if (!vec.isExactlyZero() && angle)
{
*this = *this * LLMatrix3((F32)angle, vec);
}
return *this;
}
-const LLVector3d& LLVector3d::rotVec(F64 angle, F64 x, F64 y, F64 z)
+const LLVector3d& LLVector3d::rotVec(F64 angle, F64 x, F64 y, F64 z)
{
LLVector3d vec(x, y, z);
- if ( !vec.isExactlyZero() && angle )
+ if (!vec.isExactlyZero() && angle)
{
*this = *this * LLMatrix3((F32)angle, vec);
}
@@ -129,16 +128,16 @@ const LLVector3d& LLVector3d::rotVec(F64 angle, F64 x, F64 y, F64 z)
bool LLVector3d::parseVector3d(const std::string& buf, LLVector3d* value)
{
- if( buf.empty() || value == nullptr)
+ if (buf.empty() || value == nullptr)
{
return false;
}
LLVector3d v;
- S32 count = sscanf( buf.c_str(), "%lf %lf %lf", v.mdV + 0, v.mdV + 1, v.mdV + 2 );
- if( 3 == count )
+ S32 count = sscanf(buf.c_str(), "%lf %lf %lf", v.mdV + VX, v.mdV + VY, v.mdV + VZ);
+ if (3 == count)
{
- value->setVec( v );
+ value->setVec(v);
return true;
}
diff --git a/indra/llmath/v3dmath.h b/indra/llmath/v3dmath.h
index ece8c54ea4..fcce2c30eb 100644
--- a/indra/llmath/v3dmath.h
+++ b/indra/llmath/v3dmath.h
@@ -32,128 +32,127 @@
class LLVector3d
{
- public:
- F64 mdV[3];
-
- const static LLVector3d zero;
- const static LLVector3d x_axis;
- const static LLVector3d y_axis;
- const static LLVector3d z_axis;
- const static LLVector3d x_axis_neg;
- const static LLVector3d y_axis_neg;
- const static LLVector3d z_axis_neg;
-
- inline LLVector3d(); // Initializes LLVector3d to (0, 0, 0)
- inline LLVector3d(const F64 x, const F64 y, const F64 z); // Initializes LLVector3d to (x. y, z)
- inline explicit LLVector3d(const F64 *vec); // Initializes LLVector3d to (vec[0]. vec[1], vec[2])
- inline explicit LLVector3d(const LLVector3 &vec);
- explicit LLVector3d(const LLSD& sd)
- {
- setValue(sd);
- }
-
- void setValue(const LLSD& sd)
- {
- mdV[0] = sd[0].asReal();
- mdV[1] = sd[1].asReal();
- mdV[2] = sd[2].asReal();
- }
-
- LLSD getValue() const
- {
- LLSD ret;
- ret[0] = mdV[0];
- ret[1] = mdV[1];
- ret[2] = mdV[2];
- return ret;
- }
-
- inline bool isFinite() const; // checks to see if all values of LLVector3d are finite
- bool clamp(const F64 min, const F64 max); // Clamps all values to (min,max), returns true if data changed
- bool abs(); // sets all values to absolute value of original value (first octant), returns true if changed
-
- inline const LLVector3d& clear(); // Clears LLVector3d to (0, 0, 0, 1)
- inline const LLVector3d& clearVec(); // deprecated
- inline const LLVector3d& setZero(); // Zero LLVector3d to (0, 0, 0, 0)
- inline const LLVector3d& zeroVec(); // deprecated
- inline const LLVector3d& set(const F64 x, const F64 y, const F64 z); // Sets LLVector3d to (x, y, z, 1)
- inline const LLVector3d& set(const LLVector3d &vec); // Sets LLVector3d to vec
- inline const LLVector3d& set(const F64 *vec); // Sets LLVector3d to vec
- inline const LLVector3d& set(const LLVector3 &vec);
- inline const LLVector3d& setVec(const F64 x, const F64 y, const F64 z); // deprecated
- inline const LLVector3d& setVec(const LLVector3d &vec); // deprecated
- inline const LLVector3d& setVec(const F64 *vec); // deprecated
- inline const LLVector3d& setVec(const LLVector3 &vec); // deprecated
-
- F64 magVec() const; // deprecated
- F64 magVecSquared() const; // deprecated
- inline F64 normVec(); // deprecated
-
- F64 length() const; // Returns magnitude of LLVector3d
- F64 lengthSquared() const; // Returns magnitude squared of LLVector3d
- inline F64 normalize(); // Normalizes and returns the magnitude of LLVector3d
-
- const LLVector3d& rotVec(const F64 angle, const LLVector3d &vec); // Rotates about vec by angle radians
- const LLVector3d& rotVec(const F64 angle, const F64 x, const F64 y, const F64 z); // Rotates about x,y,z by angle radians
- const LLVector3d& rotVec(const LLMatrix3 &mat); // Rotates by LLMatrix4 mat
- const LLVector3d& rotVec(const LLQuaternion &q); // Rotates by LLQuaternion q
-
- bool isNull() const; // Returns true if vector has a _very_small_ length
- bool isExactlyZero() const { return !mdV[VX] && !mdV[VY] && !mdV[VZ]; }
-
- const LLVector3d& operator=(const LLVector4 &a);
-
- F64 operator[](int idx) const { return mdV[idx]; }
- F64 &operator[](int idx) { return mdV[idx]; }
-
- friend LLVector3d operator+(const LLVector3d& a, const LLVector3d& b); // Return vector a + b
- friend LLVector3d operator-(const LLVector3d& a, const LLVector3d& b); // Return vector a minus b
- friend F64 operator*(const LLVector3d& a, const LLVector3d& b); // Return a dot b
- friend LLVector3d operator%(const LLVector3d& a, const LLVector3d& b); // Return a cross b
- friend LLVector3d operator*(const LLVector3d& a, const F64 k); // Return a times scaler k
- friend LLVector3d operator/(const LLVector3d& a, const F64 k); // Return a divided by scaler k
- friend LLVector3d operator*(const F64 k, const LLVector3d& a); // Return a times scaler k
- friend bool operator==(const LLVector3d& a, const LLVector3d& b); // Return a == b
- friend bool operator!=(const LLVector3d& a, const LLVector3d& b); // Return a != b
-
- friend const LLVector3d& operator+=(LLVector3d& a, const LLVector3d& b); // Return vector a + b
- friend const LLVector3d& operator-=(LLVector3d& a, const LLVector3d& b); // Return vector a minus b
- friend const LLVector3d& operator%=(LLVector3d& a, const LLVector3d& b); // Return a cross b
- friend const LLVector3d& operator*=(LLVector3d& a, const F64 k); // Return a times scaler k
- friend const LLVector3d& operator/=(LLVector3d& a, const F64 k); // Return a divided by scaler k
-
- friend LLVector3d operator-(const LLVector3d& a); // Return vector -a
-
- friend std::ostream& operator<<(std::ostream& s, const LLVector3d& a); // Stream a
-
- static bool parseVector3d(const std::string& buf, LLVector3d* value);
+public:
+ F64 mdV[3];
+
+ const static LLVector3d zero;
+ const static LLVector3d x_axis;
+ const static LLVector3d y_axis;
+ const static LLVector3d z_axis;
+ const static LLVector3d x_axis_neg;
+ const static LLVector3d y_axis_neg;
+ const static LLVector3d z_axis_neg;
+
+ inline LLVector3d(); // Initializes LLVector3d to (0, 0, 0)
+ inline LLVector3d(const F64 x, const F64 y, const F64 z); // Initializes LLVector3d to (x. y, z)
+ inline explicit LLVector3d(const F64 *vec); // Initializes LLVector3d to (vec[0]. vec[1], vec[2])
+ inline explicit LLVector3d(const LLVector3 &vec);
+ explicit LLVector3d(const LLSD& sd)
+ {
+ setValue(sd);
+ }
+
+ void setValue(const LLSD& sd)
+ {
+ mdV[VX] = sd[0].asReal();
+ mdV[VY] = sd[1].asReal();
+ mdV[VZ] = sd[2].asReal();
+ }
+ LLSD getValue() const
+ {
+ LLSD ret;
+ ret[0] = mdV[VX];
+ ret[1] = mdV[VY];
+ ret[2] = mdV[VZ];
+ return ret;
+ }
+
+ inline bool isFinite() const; // checks to see if all values of LLVector3d are finite
+ bool clamp(const F64 min, const F64 max); // Clamps all values to (min,max), returns true if data changed
+ bool abs(); // sets all values to absolute value of original value (first octant), returns true if changed
+
+ inline const LLVector3d& clear(); // Clears LLVector3d to (0, 0, 0, 1)
+ inline const LLVector3d& clearVec(); // deprecated
+ inline const LLVector3d& setZero(); // Zero LLVector3d to (0, 0, 0, 0)
+ inline const LLVector3d& zeroVec(); // deprecated
+ inline const LLVector3d& set(const F64 x, const F64 y, const F64 z); // Sets LLVector3d to (x, y, z, 1)
+ inline const LLVector3d& set(const LLVector3d &vec); // Sets LLVector3d to vec
+ inline const LLVector3d& set(const F64 *vec); // Sets LLVector3d to vec
+ inline const LLVector3d& set(const LLVector3 &vec);
+ inline const LLVector3d& setVec(const F64 x, const F64 y, const F64 z); // deprecated
+ inline const LLVector3d& setVec(const LLVector3d &vec); // deprecated
+ inline const LLVector3d& setVec(const F64 *vec); // deprecated
+ inline const LLVector3d& setVec(const LLVector3 &vec); // deprecated
+
+ F64 magVec() const; // deprecated
+ F64 magVecSquared() const; // deprecated
+ inline F64 normVec(); // deprecated
+
+ F64 length() const; // Returns magnitude of LLVector3d
+ F64 lengthSquared() const; // Returns magnitude squared of LLVector3d
+ inline F64 normalize(); // Normalizes and returns the magnitude of LLVector3d
+
+ const LLVector3d& rotVec(const F64 angle, const LLVector3d &vec); // Rotates about vec by angle radians
+ const LLVector3d& rotVec(const F64 angle, const F64 x, const F64 y, const F64 z); // Rotates about x,y,z by angle radians
+ const LLVector3d& rotVec(const LLMatrix3 &mat); // Rotates by LLMatrix4 mat
+ const LLVector3d& rotVec(const LLQuaternion &q); // Rotates by LLQuaternion q
+
+ bool isNull() const; // Returns true if vector has a _very_small_ length
+ bool isExactlyZero() const { return !mdV[VX] && !mdV[VY] && !mdV[VZ]; }
+
+ const LLVector3d& operator=(const LLVector4 &a);
+
+ F64 operator[](int idx) const { return mdV[idx]; }
+ F64 &operator[](int idx) { return mdV[idx]; }
+
+ friend LLVector3d operator+(const LLVector3d& a, const LLVector3d& b); // Return vector a + b
+ friend LLVector3d operator-(const LLVector3d& a, const LLVector3d& b); // Return vector a minus b
+ friend F64 operator*(const LLVector3d& a, const LLVector3d& b); // Return a dot b
+ friend LLVector3d operator%(const LLVector3d& a, const LLVector3d& b); // Return a cross b
+ friend LLVector3d operator*(const LLVector3d& a, const F64 k); // Return a times scaler k
+ friend LLVector3d operator/(const LLVector3d& a, const F64 k); // Return a divided by scaler k
+ friend LLVector3d operator*(const F64 k, const LLVector3d& a); // Return a times scaler k
+ friend bool operator==(const LLVector3d& a, const LLVector3d& b); // Return a == b
+ friend bool operator!=(const LLVector3d& a, const LLVector3d& b); // Return a != b
+
+ friend const LLVector3d& operator+=(LLVector3d& a, const LLVector3d& b); // Return vector a + b
+ friend const LLVector3d& operator-=(LLVector3d& a, const LLVector3d& b); // Return vector a minus b
+ friend const LLVector3d& operator%=(LLVector3d& a, const LLVector3d& b); // Return a cross b
+ friend const LLVector3d& operator*=(LLVector3d& a, const F64 k); // Return a times scaler k
+ friend const LLVector3d& operator/=(LLVector3d& a, const F64 k); // Return a divided by scaler k
+
+ friend LLVector3d operator-(const LLVector3d& a); // Return vector -a
+
+ friend std::ostream& operator<<(std::ostream& s, const LLVector3d& a); // Stream a
+
+ static bool parseVector3d(const std::string& buf, LLVector3d* value);
};
typedef LLVector3d LLGlobalVec;
inline const LLVector3d &LLVector3d::set(const LLVector3 &vec)
{
- mdV[0] = vec.mV[0];
- mdV[1] = vec.mV[1];
- mdV[2] = vec.mV[2];
+ mdV[VX] = vec.mV[VX];
+ mdV[VY] = vec.mV[VY];
+ mdV[VZ] = vec.mV[VZ];
return *this;
}
inline const LLVector3d &LLVector3d::setVec(const LLVector3 &vec)
{
- mdV[0] = vec.mV[0];
- mdV[1] = vec.mV[1];
- mdV[2] = vec.mV[2];
+ mdV[VX] = vec.mV[VX];
+ mdV[VY] = vec.mV[VY];
+ mdV[VZ] = vec.mV[VZ];
return *this;
}
inline LLVector3d::LLVector3d(void)
{
- mdV[0] = 0.f;
- mdV[1] = 0.f;
- mdV[2] = 0.f;
+ mdV[VX] = 0.f;
+ mdV[VY] = 0.f;
+ mdV[VZ] = 0.f;
}
inline LLVector3d::LLVector3d(const F64 x, const F64 y, const F64 z)
@@ -199,33 +198,33 @@ inline bool LLVector3d::isFinite() const
inline const LLVector3d& LLVector3d::clear(void)
{
- mdV[0] = 0.f;
- mdV[1] = 0.f;
- mdV[2]= 0.f;
+ mdV[VX] = 0.f;
+ mdV[VY] = 0.f;
+ mdV[VZ] = 0.f;
return (*this);
}
inline const LLVector3d& LLVector3d::clearVec(void)
{
- mdV[0] = 0.f;
- mdV[1] = 0.f;
- mdV[2]= 0.f;
+ mdV[VX] = 0.f;
+ mdV[VY] = 0.f;
+ mdV[VZ] = 0.f;
return (*this);
}
inline const LLVector3d& LLVector3d::setZero(void)
{
- mdV[0] = 0.f;
- mdV[1] = 0.f;
- mdV[2] = 0.f;
+ mdV[VX] = 0.f;
+ mdV[VY] = 0.f;
+ mdV[VZ] = 0.f;
return (*this);
}
inline const LLVector3d& LLVector3d::zeroVec(void)
{
- mdV[0] = 0.f;
- mdV[1] = 0.f;
- mdV[2] = 0.f;
+ mdV[VX] = 0.f;
+ mdV[VY] = 0.f;
+ mdV[VZ] = 0.f;
return (*this);
}
@@ -239,17 +238,17 @@ inline const LLVector3d& LLVector3d::set(const F64 x, const F64 y, const F64
inline const LLVector3d& LLVector3d::set(const LLVector3d &vec)
{
- mdV[0] = vec.mdV[0];
- mdV[1] = vec.mdV[1];
- mdV[2] = vec.mdV[2];
+ mdV[VX] = vec.mdV[VX];
+ mdV[VY] = vec.mdV[VY];
+ mdV[VZ] = vec.mdV[VZ];
return (*this);
}
inline const LLVector3d& LLVector3d::set(const F64 *vec)
{
- mdV[0] = vec[0];
- mdV[1] = vec[1];
- mdV[2] = vec[2];
+ mdV[VX] = vec[0];
+ mdV[VY] = vec[1];
+ mdV[VZ] = vec[2];
return (*this);
}
@@ -261,61 +260,62 @@ inline const LLVector3d& LLVector3d::setVec(const F64 x, const F64 y, const F
return (*this);
}
-inline const LLVector3d& LLVector3d::setVec(const LLVector3d &vec)
+inline const LLVector3d& LLVector3d::setVec(const LLVector3d& vec)
{
- mdV[0] = vec.mdV[0];
- mdV[1] = vec.mdV[1];
- mdV[2] = vec.mdV[2];
+ mdV[VX] = vec.mdV[VX];
+ mdV[VY] = vec.mdV[VY];
+ mdV[VZ] = vec.mdV[VZ];
return (*this);
}
-inline const LLVector3d& LLVector3d::setVec(const F64 *vec)
+inline const LLVector3d& LLVector3d::setVec(const F64* vec)
{
- mdV[0] = vec[0];
- mdV[1] = vec[1];
- mdV[2] = vec[2];
+ mdV[VX] = vec[VX];
+ mdV[VY] = vec[VY];
+ mdV[VZ] = vec[VZ];
return (*this);
}
-inline F64 LLVector3d::normVec(void)
+inline F64 LLVector3d::normVec()
{
- F64 mag = (F32) sqrt(mdV[0]*mdV[0] + mdV[1]*mdV[1] + mdV[2]*mdV[2]);
+ F64 mag = (F32)sqrt(mdV[VX]*mdV[VX] + mdV[VY]*mdV[VY] + mdV[VZ]*mdV[VZ]); // This explicit cast to F32 limits the precision for numerical stability.
+ // Without it, Unit test "v3dmath_h" fails at "1:angle_between" on macos.
F64 oomag;
if (mag > FP_MAG_THRESHOLD)
{
- oomag = 1.f/mag;
- mdV[0] *= oomag;
- mdV[1] *= oomag;
- mdV[2] *= oomag;
+ oomag = 1.0/mag;
+ mdV[VX] *= oomag;
+ mdV[VY] *= oomag;
+ mdV[VZ] *= oomag;
}
else
{
- mdV[0] = 0.f;
- mdV[1] = 0.f;
- mdV[2] = 0.f;
+ mdV[VX] = 0.0;
+ mdV[VY] = 0.0;
+ mdV[VZ] = 0.0;
mag = 0;
}
return (mag);
}
-inline F64 LLVector3d::normalize(void)
+inline F64 LLVector3d::normalize()
{
- F64 mag = (F32) sqrt(mdV[0]*mdV[0] + mdV[1]*mdV[1] + mdV[2]*mdV[2]);
+ F64 mag = (F32)sqrt(mdV[VX]*mdV[VX] + mdV[VY]*mdV[VY] + mdV[VZ]*mdV[VZ]); // Same as in normVec() above.
F64 oomag;
if (mag > FP_MAG_THRESHOLD)
{
- oomag = 1.f/mag;
- mdV[0] *= oomag;
- mdV[1] *= oomag;
- mdV[2] *= oomag;
+ oomag = 1.0/mag;
+ mdV[VX] *= oomag;
+ mdV[VY] *= oomag;
+ mdV[VZ] *= oomag;
}
else
{
- mdV[0] = 0.f;
- mdV[1] = 0.f;
- mdV[2] = 0.f;
+ mdV[VX] = 0.0;
+ mdV[VY] = 0.0;
+ mdV[VZ] = 0.0;
mag = 0;
}
return (mag);
@@ -323,24 +323,24 @@ inline F64 LLVector3d::normalize(void)
// LLVector3d Magnitude and Normalization Functions
-inline F64 LLVector3d::magVec(void) const
+inline F64 LLVector3d::magVec() const
{
- return (F32) sqrt(mdV[0]*mdV[0] + mdV[1]*mdV[1] + mdV[2]*mdV[2]);
+ return sqrt(mdV[VX]*mdV[VX] + mdV[VY]*mdV[VY] + mdV[VZ]*mdV[VZ]);
}
-inline F64 LLVector3d::magVecSquared(void) const
+inline F64 LLVector3d::magVecSquared() const
{
- return mdV[0]*mdV[0] + mdV[1]*mdV[1] + mdV[2]*mdV[2];
+ return mdV[VX]*mdV[VX] + mdV[VY]*mdV[VY] + mdV[VZ]*mdV[VZ];
}
-inline F64 LLVector3d::length(void) const
+inline F64 LLVector3d::length() const
{
- return (F32) sqrt(mdV[0]*mdV[0] + mdV[1]*mdV[1] + mdV[2]*mdV[2]);
+ return sqrt(mdV[VX]*mdV[VX] + mdV[VY]*mdV[VY] + mdV[VZ]*mdV[VZ]);
}
-inline F64 LLVector3d::lengthSquared(void) const
+inline F64 LLVector3d::lengthSquared() const
{
- return mdV[0]*mdV[0] + mdV[1]*mdV[1] + mdV[2]*mdV[2];
+ return mdV[VX]*mdV[VX] + mdV[VY]*mdV[VY] + mdV[VZ]*mdV[VZ];
}
inline LLVector3d operator+(const LLVector3d& a, const LLVector3d& b)
@@ -357,109 +357,109 @@ inline LLVector3d operator-(const LLVector3d& a, const LLVector3d& b)
inline F64 operator*(const LLVector3d& a, const LLVector3d& b)
{
- return (a.mdV[0]*b.mdV[0] + a.mdV[1]*b.mdV[1] + a.mdV[2]*b.mdV[2]);
+ return (a.mdV[VX]*b.mdV[VX] + a.mdV[VY]*b.mdV[VY] + a.mdV[VZ]*b.mdV[VZ]);
}
inline LLVector3d operator%(const LLVector3d& a, const LLVector3d& b)
{
- return LLVector3d( a.mdV[1]*b.mdV[2] - b.mdV[1]*a.mdV[2], a.mdV[2]*b.mdV[0] - b.mdV[2]*a.mdV[0], a.mdV[0]*b.mdV[1] - b.mdV[0]*a.mdV[1] );
+ return LLVector3d( a.mdV[VY]*b.mdV[VZ] - b.mdV[VY]*a.mdV[VZ], a.mdV[VZ]*b.mdV[VX] - b.mdV[VZ]*a.mdV[VX], a.mdV[VX]*b.mdV[VY] - b.mdV[VX]*a.mdV[VY] );
}
inline LLVector3d operator/(const LLVector3d& a, const F64 k)
{
F64 t = 1.f / k;
- return LLVector3d( a.mdV[0] * t, a.mdV[1] * t, a.mdV[2] * t );
+ return LLVector3d( a.mdV[VX] * t, a.mdV[VY] * t, a.mdV[VZ] * t );
}
inline LLVector3d operator*(const LLVector3d& a, const F64 k)
{
- return LLVector3d( a.mdV[0] * k, a.mdV[1] * k, a.mdV[2] * k );
+ return LLVector3d( a.mdV[VX] * k, a.mdV[VY] * k, a.mdV[VZ] * k );
}
inline LLVector3d operator*(F64 k, const LLVector3d& a)
{
- return LLVector3d( a.mdV[0] * k, a.mdV[1] * k, a.mdV[2] * k );
+ return LLVector3d( a.mdV[VX] * k, a.mdV[VY] * k, a.mdV[VZ] * k );
}
inline bool operator==(const LLVector3d& a, const LLVector3d& b)
{
- return ( (a.mdV[0] == b.mdV[0])
- &&(a.mdV[1] == b.mdV[1])
- &&(a.mdV[2] == b.mdV[2]));
+ return ( (a.mdV[VX] == b.mdV[VX])
+ &&(a.mdV[VY] == b.mdV[VY])
+ &&(a.mdV[VZ] == b.mdV[VZ]));
}
inline bool operator!=(const LLVector3d& a, const LLVector3d& b)
{
- return ( (a.mdV[0] != b.mdV[0])
- ||(a.mdV[1] != b.mdV[1])
- ||(a.mdV[2] != b.mdV[2]));
+ return ( (a.mdV[VX] != b.mdV[VX])
+ ||(a.mdV[VY] != b.mdV[VY])
+ ||(a.mdV[VZ] != b.mdV[VZ]));
}
inline const LLVector3d& operator+=(LLVector3d& a, const LLVector3d& b)
{
- a.mdV[0] += b.mdV[0];
- a.mdV[1] += b.mdV[1];
- a.mdV[2] += b.mdV[2];
+ a.mdV[VX] += b.mdV[VX];
+ a.mdV[VY] += b.mdV[VY];
+ a.mdV[VZ] += b.mdV[VZ];
return a;
}
inline const LLVector3d& operator-=(LLVector3d& a, const LLVector3d& b)
{
- a.mdV[0] -= b.mdV[0];
- a.mdV[1] -= b.mdV[1];
- a.mdV[2] -= b.mdV[2];
+ a.mdV[VX] -= b.mdV[VX];
+ a.mdV[VY] -= b.mdV[VY];
+ a.mdV[VZ] -= b.mdV[VZ];
return a;
}
inline const LLVector3d& operator%=(LLVector3d& a, const LLVector3d& b)
{
- LLVector3d ret( a.mdV[1]*b.mdV[2] - b.mdV[1]*a.mdV[2], a.mdV[2]*b.mdV[0] - b.mdV[2]*a.mdV[0], a.mdV[0]*b.mdV[1] - b.mdV[0]*a.mdV[1]);
+ LLVector3d ret( a.mdV[VY]*b.mdV[VZ] - b.mdV[VY]*a.mdV[VZ], a.mdV[VZ]*b.mdV[VX] - b.mdV[VZ]*a.mdV[VX], a.mdV[VX]*b.mdV[VY] - b.mdV[VX]*a.mdV[VY]);
a = ret;
return a;
}
inline const LLVector3d& operator*=(LLVector3d& a, const F64 k)
{
- a.mdV[0] *= k;
- a.mdV[1] *= k;
- a.mdV[2] *= k;
+ a.mdV[VX] *= k;
+ a.mdV[VY] *= k;
+ a.mdV[VZ] *= k;
return a;
}
inline const LLVector3d& operator/=(LLVector3d& a, const F64 k)
{
F64 t = 1.f / k;
- a.mdV[0] *= t;
- a.mdV[1] *= t;
- a.mdV[2] *= t;
+ a.mdV[VX] *= t;
+ a.mdV[VY] *= t;
+ a.mdV[VZ] *= t;
return a;
}
inline LLVector3d operator-(const LLVector3d& a)
{
- return LLVector3d( -a.mdV[0], -a.mdV[1], -a.mdV[2] );
+ return LLVector3d( -a.mdV[VX], -a.mdV[VY], -a.mdV[VZ] );
}
inline F64 dist_vec(const LLVector3d& a, const LLVector3d& b)
{
- F64 x = a.mdV[0] - b.mdV[0];
- F64 y = a.mdV[1] - b.mdV[1];
- F64 z = a.mdV[2] - b.mdV[2];
+ F64 x = a.mdV[VX] - b.mdV[VX];
+ F64 y = a.mdV[VY] - b.mdV[VY];
+ F64 z = a.mdV[VZ] - b.mdV[VZ];
return (F32) sqrt( x*x + y*y + z*z );
}
inline F64 dist_vec_squared(const LLVector3d& a, const LLVector3d& b)
{
- F64 x = a.mdV[0] - b.mdV[0];
- F64 y = a.mdV[1] - b.mdV[1];
- F64 z = a.mdV[2] - b.mdV[2];
+ F64 x = a.mdV[VX] - b.mdV[VX];
+ F64 y = a.mdV[VY] - b.mdV[VY];
+ F64 z = a.mdV[VZ] - b.mdV[VZ];
return x*x + y*y + z*z;
}
inline F64 dist_vec_squared2D(const LLVector3d& a, const LLVector3d& b)
{
- F64 x = a.mdV[0] - b.mdV[0];
- F64 y = a.mdV[1] - b.mdV[1];
+ F64 x = a.mdV[VX] - b.mdV[VX];
+ F64 y = a.mdV[VY] - b.mdV[VY];
return x*x + y*y;
}
diff --git a/indra/llmath/v3math.cpp b/indra/llmath/v3math.cpp
index 73ad2a4ed6..eac95ed023 100644
--- a/indra/llmath/v3math.cpp
+++ b/indra/llmath/v3math.cpp
@@ -28,7 +28,6 @@
#include "v3math.h"
-//#include "vmath.h"
#include "v2math.h"
#include "v4math.h"
#include "m4math.h"
@@ -58,13 +57,13 @@ bool LLVector3::clamp(F32 min, F32 max)
{
bool ret{ false };
- if (mV[0] < min) { mV[0] = min; ret = true; }
- if (mV[1] < min) { mV[1] = min; ret = true; }
- if (mV[2] < min) { mV[2] = min; ret = true; }
+ if (mV[VX] < min) { mV[VX] = min; ret = true; }
+ if (mV[VY] < min) { mV[VY] = min; ret = true; }
+ if (mV[VZ] < min) { mV[VZ] = min; ret = true; }
- if (mV[0] > max) { mV[0] = max; ret = true; }
- if (mV[1] > max) { mV[1] = max; ret = true; }
- if (mV[2] > max) { mV[2] = max; ret = true; }
+ if (mV[VX] > max) { mV[VX] = max; ret = true; }
+ if (mV[VY] > max) { mV[VY] = max; ret = true; }
+ if (mV[VZ] > max) { mV[VZ] = max; ret = true; }
return ret;
}
@@ -85,9 +84,9 @@ bool LLVector3::clampLength( F32 length_limit )
{
length_limit = 0.f;
}
- mV[0] *= length_limit;
- mV[1] *= length_limit;
- mV[2] *= length_limit;
+ mV[VX] *= length_limit;
+ mV[VY] *= length_limit;
+ mV[VZ] *= length_limit;
changed = true;
}
}
@@ -116,35 +115,35 @@ bool LLVector3::clampLength( F32 length_limit )
{
// yes it can be salvaged -->
// bring the components down before we normalize
- mV[0] /= max_abs_component;
- mV[1] /= max_abs_component;
- mV[2] /= max_abs_component;
+ mV[VX] /= max_abs_component;
+ mV[VY] /= max_abs_component;
+ mV[VZ] /= max_abs_component;
normalize();
if (length_limit < 0.f)
{
length_limit = 0.f;
}
- mV[0] *= length_limit;
- mV[1] *= length_limit;
- mV[2] *= length_limit;
+ mV[VX] *= length_limit;
+ mV[VY] *= length_limit;
+ mV[VZ] *= length_limit;
}
}
return changed;
}
-bool LLVector3::clamp(const LLVector3 &min_vec, const LLVector3 &max_vec)
+bool LLVector3::clamp(const LLVector3& min_vec, const LLVector3& max_vec)
{
bool ret{ false };
- if (mV[0] < min_vec[0]) { mV[0] = min_vec[0]; ret = true; }
- if (mV[1] < min_vec[1]) { mV[1] = min_vec[1]; ret = true; }
- if (mV[2] < min_vec[2]) { mV[2] = min_vec[2]; ret = true; }
+ if (mV[VX] < min_vec[0]) { mV[VX] = min_vec[0]; ret = true; }
+ if (mV[VY] < min_vec[1]) { mV[VY] = min_vec[1]; ret = true; }
+ if (mV[VZ] < min_vec[2]) { mV[VZ] = min_vec[2]; ret = true; }
- if (mV[0] > max_vec[0]) { mV[0] = max_vec[0]; ret = true; }
- if (mV[1] > max_vec[1]) { mV[1] = max_vec[1]; ret = true; }
- if (mV[2] > max_vec[2]) { mV[2] = max_vec[2]; ret = true; }
+ if (mV[VX] > max_vec[0]) { mV[VX] = max_vec[0]; ret = true; }
+ if (mV[VY] > max_vec[1]) { mV[VY] = max_vec[1]; ret = true; }
+ if (mV[VZ] > max_vec[2]) { mV[VZ] = max_vec[2]; ret = true; }
return ret;
}
@@ -156,15 +155,15 @@ bool LLVector3::abs()
{
bool ret{ false };
- if (mV[0] < 0.f) { mV[0] = -mV[0]; ret = true; }
- if (mV[1] < 0.f) { mV[1] = -mV[1]; ret = true; }
- if (mV[2] < 0.f) { mV[2] = -mV[2]; ret = true; }
+ if (mV[VX] < 0.f) { mV[VX] = -mV[VX]; ret = true; }
+ if (mV[VY] < 0.f) { mV[VY] = -mV[VY]; ret = true; }
+ if (mV[VZ] < 0.f) { mV[VZ] = -mV[VZ]; ret = true; }
return ret;
}
// Quatizations
-void LLVector3::quantize16(F32 lowerxy, F32 upperxy, F32 lowerz, F32 upperz)
+void LLVector3::quantize16(F32 lowerxy, F32 upperxy, F32 lowerz, F32 upperz)
{
F32 x = mV[VX];
F32 y = mV[VY];
@@ -179,7 +178,7 @@ void LLVector3::quantize16(F32 lowerxy, F32 upperxy, F32 lowerz, F32 upperz)
mV[VZ] = z;
}
-void LLVector3::quantize8(F32 lowerxy, F32 upperxy, F32 lowerz, F32 upperz)
+void LLVector3::quantize8(F32 lowerxy, F32 upperxy, F32 lowerz, F32 upperz)
{
mV[VX] = U8_to_F32(F32_to_U8(mV[VX], lowerxy, upperxy), lowerxy, upperxy);;
mV[VY] = U8_to_F32(F32_to_U8(mV[VY], lowerxy, upperxy), lowerxy, upperxy);
@@ -187,20 +186,20 @@ void LLVector3::quantize8(F32 lowerxy, F32 upperxy, F32 lowerz, F32 upperz)
}
-void LLVector3::snap(S32 sig_digits)
+void LLVector3::snap(S32 sig_digits)
{
mV[VX] = snap_to_sig_figs(mV[VX], sig_digits);
mV[VY] = snap_to_sig_figs(mV[VY], sig_digits);
mV[VZ] = snap_to_sig_figs(mV[VZ], sig_digits);
}
-const LLVector3& LLVector3::rotVec(const LLMatrix3 &mat)
+const LLVector3& LLVector3::rotVec(const LLMatrix3& mat)
{
*this = *this * mat;
return *this;
}
-const LLVector3& LLVector3::rotVec(const LLQuaternion &q)
+const LLVector3& LLVector3::rotVec(const LLQuaternion& q)
{
*this = *this * q;
return *this;
@@ -228,26 +227,26 @@ const LLVector3& LLVector3::transVec(const LLMatrix4& mat)
}
-const LLVector3& LLVector3::rotVec(F32 angle, const LLVector3 &vec)
+const LLVector3& LLVector3::rotVec(F32 angle, const LLVector3& vec)
{
- if ( !vec.isExactlyZero() && angle )
+ if (!vec.isExactlyZero() && angle)
{
*this = *this * LLQuaternion(angle, vec);
}
return *this;
}
-const LLVector3& LLVector3::rotVec(F32 angle, F32 x, F32 y, F32 z)
+const LLVector3& LLVector3::rotVec(F32 angle, F32 x, F32 y, F32 z)
{
LLVector3 vec(x, y, z);
- if ( !vec.isExactlyZero() && angle )
+ if (!vec.isExactlyZero() && angle)
{
*this = *this * LLQuaternion(angle, vec);
}
return *this;
}
-const LLVector3& LLVector3::scaleVec(const LLVector3& vec)
+const LLVector3& LLVector3::scaleVec(const LLVector3& vec)
{
mV[VX] *= vec.mV[VX];
mV[VY] *= vec.mV[VY];
@@ -256,42 +255,42 @@ const LLVector3& LLVector3::scaleVec(const LLVector3& vec)
return *this;
}
-LLVector3 LLVector3::scaledVec(const LLVector3& vec) const
+LLVector3 LLVector3::scaledVec(const LLVector3& vec) const
{
LLVector3 ret = LLVector3(*this);
ret.scaleVec(vec);
return ret;
}
-const LLVector3& LLVector3::set(const LLVector3d &vec)
+const LLVector3& LLVector3::set(const LLVector3d& vec)
{
- mV[0] = (F32)vec.mdV[0];
- mV[1] = (F32)vec.mdV[1];
- mV[2] = (F32)vec.mdV[2];
+ mV[VX] = (F32)vec.mdV[VX];
+ mV[VY] = (F32)vec.mdV[VY];
+ mV[VZ] = (F32)vec.mdV[VZ];
return (*this);
}
-const LLVector3& LLVector3::set(const LLVector4 &vec)
+const LLVector3& LLVector3::set(const LLVector4& vec)
{
- mV[0] = vec.mV[0];
- mV[1] = vec.mV[1];
- mV[2] = vec.mV[2];
+ mV[VX] = vec.mV[VX];
+ mV[VY] = vec.mV[VY];
+ mV[VZ] = vec.mV[VZ];
return (*this);
}
-const LLVector3& LLVector3::setVec(const LLVector3d &vec)
+const LLVector3& LLVector3::setVec(const LLVector3d& vec)
{
- mV[0] = (F32)vec.mdV[0];
- mV[1] = (F32)vec.mdV[1];
- mV[2] = (F32)vec.mdV[2];
+ mV[VX] = (F32)vec.mdV[0];
+ mV[VY] = (F32)vec.mdV[1];
+ mV[VZ] = (F32)vec.mdV[2];
return (*this);
}
-const LLVector3& LLVector3::setVec(const LLVector4 &vec)
+const LLVector3& LLVector3::setVec(const LLVector4& vec)
{
- mV[0] = vec.mV[0];
- mV[1] = vec.mV[1];
- mV[2] = vec.mV[2];
+ mV[VX] = vec.mV[VX];
+ mV[VY] = vec.mV[VY];
+ mV[VZ] = vec.mV[VZ];
return (*this);
}
@@ -299,17 +298,17 @@ LLVector3::LLVector3(const LLVector2 &vec)
{
mV[VX] = (F32)vec.mV[VX];
mV[VY] = (F32)vec.mV[VY];
- mV[VZ] = 0;
+ mV[VZ] = 0.f;
}
-LLVector3::LLVector3(const LLVector3d &vec)
+LLVector3::LLVector3(const LLVector3d& vec)
{
mV[VX] = (F32)vec.mdV[VX];
mV[VY] = (F32)vec.mdV[VY];
mV[VZ] = (F32)vec.mdV[VZ];
}
-LLVector3::LLVector3(const LLVector4 &vec)
+LLVector3::LLVector3(const LLVector4& vec)
{
mV[VX] = (F32)vec.mV[VX];
mV[VY] = (F32)vec.mV[VY];
@@ -319,7 +318,6 @@ LLVector3::LLVector3(const LLVector4 &vec)
LLVector3::LLVector3(const LLVector4a& vec)
: LLVector3(vec.getF32ptr())
{
-
}
LLVector3::LLVector3(const LLSD& sd)
@@ -330,20 +328,20 @@ LLVector3::LLVector3(const LLSD& sd)
LLSD LLVector3::getValue() const
{
LLSD ret;
- ret[0] = mV[0];
- ret[1] = mV[1];
- ret[2] = mV[2];
+ ret[VX] = mV[VX];
+ ret[VY] = mV[VY];
+ ret[VZ] = mV[VZ];
return ret;
}
void LLVector3::setValue(const LLSD& sd)
{
- mV[0] = (F32) sd[0].asReal();
- mV[1] = (F32) sd[1].asReal();
- mV[2] = (F32) sd[2].asReal();
+ mV[VX] = (F32) sd[VX].asReal();
+ mV[VY] = (F32) sd[VY].asReal();
+ mV[VZ] = (F32) sd[VZ].asReal();
}
-const LLVector3& operator*=(LLVector3 &a, const LLQuaternion &rot)
+const LLVector3& operator*=(LLVector3& a, const LLQuaternion& rot)
{
const F32 rw = - rot.mQ[VX] * a.mV[VX] - rot.mQ[VY] * a.mV[VY] - rot.mQ[VZ] * a.mV[VZ];
const F32 rx = rot.mQ[VW] * a.mV[VX] + rot.mQ[VY] * a.mV[VZ] - rot.mQ[VZ] * a.mV[VY];
@@ -360,16 +358,16 @@ const LLVector3& operator*=(LLVector3 &a, const LLQuaternion &rot)
// static
bool LLVector3::parseVector3(const std::string& buf, LLVector3* value)
{
- if( buf.empty() || value == nullptr)
+ if (buf.empty() || value == nullptr)
{
return false;
}
LLVector3 v;
- S32 count = sscanf( buf.c_str(), "%f %f %f", v.mV + 0, v.mV + 1, v.mV + 2 );
- if( 3 == count )
+ S32 count = sscanf(buf.c_str(), "%f %f %f", v.mV + VX, v.mV + VY, v.mV + VZ);
+ if (3 == count)
{
- value->setVec( v );
+ value->setVec(v);
return true;
}
@@ -381,7 +379,7 @@ bool LLVector3::parseVector3(const std::string& buf, LLVector3* value)
LLVector3 point_to_box_offset(LLVector3& pos, const LLVector3* box)
{
LLVector3 offset;
- for (S32 k=0; k<3; k++)
+ for (S32 k = 0; k < 3; k++)
{
offset[k] = 0;
if (pos[k] < box[0][k])
@@ -410,4 +408,3 @@ bool box_valid_and_non_zero(const LLVector3* box)
}
return false;
}
-
diff --git a/indra/llmath/v3math.h b/indra/llmath/v3math.h
index a3bfa68060..baf38e4a3a 100644
--- a/indra/llmath/v3math.h
+++ b/indra/llmath/v3math.h
@@ -46,7 +46,7 @@ class LLQuaternion;
// LLvector3 = |x y z w|
-static const U32 LENGTHOFVECTOR3 = 3;
+static constexpr U32 LENGTHOFVECTOR3 = 3;
class LLVector3
{
@@ -112,24 +112,24 @@ class LLVector3
const LLVector3& setVec(const LLVector4 &vec); // deprecated
const LLVector3& setVec(const LLVector3d &vec); // deprecated
- F32 length() const; // Returns magnitude of LLVector3
- F32 lengthSquared() const; // Returns magnitude squared of LLVector3
- F32 magVec() const; // deprecated
- F32 magVecSquared() const; // deprecated
+ F32 length() const; // Returns magnitude of LLVector3
+ F32 lengthSquared() const; // Returns magnitude squared of LLVector3
+ F32 magVec() const; // deprecated
+ F32 magVecSquared() const; // deprecated
- inline F32 normalize(); // Normalizes and returns the magnitude of LLVector3
- inline F32 normVec(); // deprecated
+ inline F32 normalize(); // Normalizes and returns the magnitude of LLVector3
+ inline F32 normVec(); // deprecated
- inline bool inRange( F32 min, F32 max ) const; // Returns true if all values of the vector are between min and max
+ inline bool inRange(F32 min, F32 max) const; // Returns true if all values of the vector are between min and max
- const LLVector3& rotVec(F32 angle, const LLVector3 &vec); // Rotates about vec by angle radians
- const LLVector3& rotVec(F32 angle, F32 x, F32 y, F32 z); // Rotates about x,y,z by angle radians
- const LLVector3& rotVec(const LLMatrix3 &mat); // Rotates by LLMatrix4 mat
- const LLVector3& rotVec(const LLQuaternion &q); // Rotates by LLQuaternion q
- const LLVector3& transVec(const LLMatrix4& mat); // Transforms by LLMatrix4 mat (mat * v)
+ const LLVector3& rotVec(F32 angle, const LLVector3 &vec); // Rotates about vec by angle radians
+ const LLVector3& rotVec(F32 angle, F32 x, F32 y, F32 z); // Rotates about x,y,z by angle radians
+ const LLVector3& rotVec(const LLMatrix3 &mat); // Rotates by LLMatrix4 mat
+ const LLVector3& rotVec(const LLQuaternion &q); // Rotates by LLQuaternion q
+ const LLVector3& transVec(const LLMatrix4& mat); // Transforms by LLMatrix4 mat (mat * v)
- const LLVector3& scaleVec(const LLVector3& vec); // scales per component by vec
- LLVector3 scaledVec(const LLVector3& vec) const; // get a copy of this vector scaled by vec
+ const LLVector3& scaleVec(const LLVector3& vec); // scales per component by vec
+ LLVector3 scaledVec(const LLVector3& vec) const; // get a copy of this vector scaled by vec
bool isNull() const; // Returns true if vector has a _very_small_ length
bool isExactlyZero() const { return !mV[VX] && !mV[VY] && !mV[VZ]; }
@@ -181,25 +181,19 @@ LLVector3 lerp(const LLVector3 &a, const LLVector3 &b, F32 u); // Returns a vect
LLVector3 point_to_box_offset(LLVector3& pos, const LLVector3* box); // Displacement from query point to nearest point on bounding box.
bool box_valid_and_non_zero(const LLVector3* box);
-inline LLVector3::LLVector3(void)
+inline LLVector3::LLVector3()
{
- mV[0] = 0.f;
- mV[1] = 0.f;
- mV[2] = 0.f;
+ clear();
}
inline LLVector3::LLVector3(const F32 x, const F32 y, const F32 z)
{
- mV[VX] = x;
- mV[VY] = y;
- mV[VZ] = z;
+ set(x, y, z);
}
inline LLVector3::LLVector3(const F32 *vec)
{
- mV[VX] = vec[VX];
- mV[VY] = vec[VY];
- mV[VZ] = vec[VZ];
+ set(vec);
}
inline LLVector3::LLVector3(const glm::vec3& vec)
@@ -230,38 +224,30 @@ inline LLVector3::LLVector3(const LLVector3 &copy)
// checker
inline bool LLVector3::isFinite() const
{
- return (llfinite(mV[VX]) && llfinite(mV[VY]) && llfinite(mV[VZ]));
+ return llfinite(mV[VX]) && llfinite(mV[VY]) && llfinite(mV[VZ]);
}
// Clear and Assignment Functions
-inline void LLVector3::clear(void)
+inline void LLVector3::clear()
{
- mV[0] = 0.f;
- mV[1] = 0.f;
- mV[2] = 0.f;
+ set(0.f, 0.f, 0.f);
}
-inline void LLVector3::setZero(void)
+inline void LLVector3::setZero()
{
- mV[0] = 0.f;
- mV[1] = 0.f;
- mV[2] = 0.f;
+ clear();
}
-inline void LLVector3::clearVec(void)
+inline void LLVector3::clearVec()
{
- mV[0] = 0.f;
- mV[1] = 0.f;
- mV[2] = 0.f;
+ clear();
}
-inline void LLVector3::zeroVec(void)
+inline void LLVector3::zeroVec()
{
- mV[0] = 0.f;
- mV[1] = 0.f;
- mV[2] = 0.f;
+ clear();
}
inline void LLVector3::set(F32 x, F32 y, F32 z)
@@ -271,18 +257,14 @@ inline void LLVector3::set(F32 x, F32 y, F32 z)
mV[VZ] = z;
}
-inline void LLVector3::set(const LLVector3 &vec)
+inline void LLVector3::set(const LLVector3& vec)
{
- mV[0] = vec.mV[0];
- mV[1] = vec.mV[1];
- mV[2] = vec.mV[2];
+ set(vec.mV[VX], vec.mV[VY], vec.mV[VZ]);
}
-inline void LLVector3::set(const F32 *vec)
+inline void LLVector3::set(const F32* vec)
{
- mV[0] = vec[0];
- mV[1] = vec[1];
- mV[2] = vec[2];
+ set(vec[0], vec[1], vec[2]);
}
inline void LLVector3::set(const glm::vec4& vec)
@@ -302,213 +284,181 @@ inline void LLVector3::set(const glm::vec3& vec)
// deprecated
inline void LLVector3::setVec(F32 x, F32 y, F32 z)
{
- mV[VX] = x;
- mV[VY] = y;
- mV[VZ] = z;
+ set(x, y, z);
}
// deprecated
-inline void LLVector3::setVec(const LLVector3 &vec)
+inline void LLVector3::setVec(const LLVector3& vec)
{
- mV[0] = vec.mV[0];
- mV[1] = vec.mV[1];
- mV[2] = vec.mV[2];
+ set(vec);
}
// deprecated
-inline void LLVector3::setVec(const F32 *vec)
+inline void LLVector3::setVec(const F32* vec)
{
- mV[0] = vec[0];
- mV[1] = vec[1];
- mV[2] = vec[2];
+ set(vec);
}
-inline F32 LLVector3::normalize(void)
+inline F32 LLVector3::normalize()
{
- F32 mag = (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]);
- F32 oomag;
+ F32 mag = (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]);
if (mag > FP_MAG_THRESHOLD)
{
- oomag = 1.f/mag;
- mV[0] *= oomag;
- mV[1] *= oomag;
- mV[2] *= oomag;
+ *this /= mag;
}
else
{
- mV[0] = 0.f;
- mV[1] = 0.f;
- mV[2] = 0.f;
+ clear();
mag = 0;
}
- return (mag);
+ return mag;
}
// deprecated
-inline F32 LLVector3::normVec(void)
+inline F32 LLVector3::normVec()
{
- F32 mag = (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]);
- F32 oomag;
-
- if (mag > FP_MAG_THRESHOLD)
- {
- oomag = 1.f/mag;
- mV[0] *= oomag;
- mV[1] *= oomag;
- mV[2] *= oomag;
- }
- else
- {
- mV[0] = 0.f;
- mV[1] = 0.f;
- mV[2] = 0.f;
- mag = 0;
- }
- return (mag);
+ return normalize();
}
// LLVector3 Magnitude and Normalization Functions
-inline F32 LLVector3::length(void) const
+inline F32 LLVector3::length() const
{
- return (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]);
+ return sqrt(lengthSquared());
}
-inline F32 LLVector3::lengthSquared(void) const
+inline F32 LLVector3::lengthSquared() const
{
- return mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2];
+ return mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ];
}
-inline F32 LLVector3::magVec(void) const
+inline F32 LLVector3::magVec() const
{
- return (F32) sqrt(mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2]);
+ return length();
}
-inline F32 LLVector3::magVecSquared(void) const
+inline F32 LLVector3::magVecSquared() const
{
- return mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2];
+ return lengthSquared();
}
inline bool LLVector3::inRange( F32 min, F32 max ) const
{
- return mV[0] >= min && mV[0] <= max &&
- mV[1] >= min && mV[1] <= max &&
- mV[2] >= min && mV[2] <= max;
+ return mV[VX] >= min && mV[VX] <= max &&
+ mV[VY] >= min && mV[VY] <= max &&
+ mV[VZ] >= min && mV[VZ] <= max;
}
-inline LLVector3 operator+(const LLVector3 &a, const LLVector3 &b)
+inline LLVector3 operator+(const LLVector3& a, const LLVector3& b)
{
LLVector3 c(a);
return c += b;
}
-inline LLVector3 operator-(const LLVector3 &a, const LLVector3 &b)
+inline LLVector3 operator-(const LLVector3& a, const LLVector3& b)
{
LLVector3 c(a);
return c -= b;
}
-inline F32 operator*(const LLVector3 &a, const LLVector3 &b)
+inline F32 operator*(const LLVector3& a, const LLVector3& b)
{
- return (a.mV[0]*b.mV[0] + a.mV[1]*b.mV[1] + a.mV[2]*b.mV[2]);
+ return (a.mV[VX]*b.mV[VX] + a.mV[VY]*b.mV[VY] + a.mV[VZ]*b.mV[VZ]);
}
-inline LLVector3 operator%(const LLVector3 &a, const LLVector3 &b)
+inline LLVector3 operator%(const LLVector3& a, const LLVector3& b)
{
- return LLVector3( a.mV[1]*b.mV[2] - b.mV[1]*a.mV[2], a.mV[2]*b.mV[0] - b.mV[2]*a.mV[0], a.mV[0]*b.mV[1] - b.mV[0]*a.mV[1] );
+ return LLVector3( a.mV[VY]*b.mV[VZ] - b.mV[VY]*a.mV[VZ], a.mV[VZ]*b.mV[VX] - b.mV[VZ]*a.mV[VX], a.mV[VX]*b.mV[VY] - b.mV[VX]*a.mV[VY] );
}
-inline LLVector3 operator/(const LLVector3 &a, F32 k)
+inline LLVector3 operator/(const LLVector3& a, F32 k)
{
F32 t = 1.f / k;
- return LLVector3( a.mV[0] * t, a.mV[1] * t, a.mV[2] * t );
+ return LLVector3( a.mV[VX] * t, a.mV[VY] * t, a.mV[VZ] * t );
}
-inline LLVector3 operator*(const LLVector3 &a, F32 k)
+inline LLVector3 operator*(const LLVector3& a, F32 k)
{
- return LLVector3( a.mV[0] * k, a.mV[1] * k, a.mV[2] * k );
+ return LLVector3( a.mV[VX] * k, a.mV[VY] * k, a.mV[VZ] * k );
}
-inline LLVector3 operator*(F32 k, const LLVector3 &a)
+inline LLVector3 operator*(F32 k, const LLVector3& a)
{
- return LLVector3( a.mV[0] * k, a.mV[1] * k, a.mV[2] * k );
+ return LLVector3( a.mV[VX] * k, a.mV[VY] * k, a.mV[VZ] * k );
}
-inline bool operator==(const LLVector3 &a, const LLVector3 &b)
+inline bool operator==(const LLVector3& a, const LLVector3& b)
{
- return ( (a.mV[0] == b.mV[0])
- &&(a.mV[1] == b.mV[1])
- &&(a.mV[2] == b.mV[2]));
+ return ( (a.mV[VX] == b.mV[VX])
+ &&(a.mV[VY] == b.mV[VY])
+ &&(a.mV[VZ] == b.mV[VZ]));
}
-inline bool operator!=(const LLVector3 &a, const LLVector3 &b)
+inline bool operator!=(const LLVector3& a, const LLVector3& b)
{
- return ( (a.mV[0] != b.mV[0])
- ||(a.mV[1] != b.mV[1])
- ||(a.mV[2] != b.mV[2]));
+ return ( (a.mV[VX] != b.mV[VX])
+ ||(a.mV[VY] != b.mV[VY])
+ ||(a.mV[VZ] != b.mV[VZ]));
}
-inline bool operator<(const LLVector3 &a, const LLVector3 &b)
+inline bool operator<(const LLVector3& a, const LLVector3& b)
{
- return (a.mV[0] < b.mV[0]
- || (a.mV[0] == b.mV[0]
- && (a.mV[1] < b.mV[1]
- || ((a.mV[1] == b.mV[1])
- && a.mV[2] < b.mV[2]))));
+ return (a.mV[VX] < b.mV[VX]
+ || (a.mV[VX] == b.mV[VX]
+ && (a.mV[VY] < b.mV[VY]
+ || ((a.mV[VY] == b.mV[VY])
+ && a.mV[VZ] < b.mV[VZ]))));
}
-inline const LLVector3& operator+=(LLVector3 &a, const LLVector3 &b)
+inline const LLVector3& operator+=(LLVector3& a, const LLVector3& b)
{
- a.mV[0] += b.mV[0];
- a.mV[1] += b.mV[1];
- a.mV[2] += b.mV[2];
+ a.mV[VX] += b.mV[VX];
+ a.mV[VY] += b.mV[VY];
+ a.mV[VZ] += b.mV[VZ];
return a;
}
-inline const LLVector3& operator-=(LLVector3 &a, const LLVector3 &b)
+inline const LLVector3& operator-=(LLVector3& a, const LLVector3& b)
{
- a.mV[0] -= b.mV[0];
- a.mV[1] -= b.mV[1];
- a.mV[2] -= b.mV[2];
+ a.mV[VX] -= b.mV[VX];
+ a.mV[VY] -= b.mV[VY];
+ a.mV[VZ] -= b.mV[VZ];
return a;
}
-inline const LLVector3& operator%=(LLVector3 &a, const LLVector3 &b)
+inline const LLVector3& operator%=(LLVector3& a, const LLVector3& b)
{
- LLVector3 ret( a.mV[1]*b.mV[2] - b.mV[1]*a.mV[2], a.mV[2]*b.mV[0] - b.mV[2]*a.mV[0], a.mV[0]*b.mV[1] - b.mV[0]*a.mV[1]);
+ LLVector3 ret( a.mV[VY]*b.mV[VZ] - b.mV[VY]*a.mV[VZ], a.mV[VZ]*b.mV[VX] - b.mV[VZ]*a.mV[VX], a.mV[VX]*b.mV[VY] - b.mV[VX]*a.mV[VY]);
a = ret;
return a;
}
-inline const LLVector3& operator*=(LLVector3 &a, F32 k)
+inline const LLVector3& operator*=(LLVector3& a, F32 k)
{
- a.mV[0] *= k;
- a.mV[1] *= k;
- a.mV[2] *= k;
+ a.mV[VX] *= k;
+ a.mV[VY] *= k;
+ a.mV[VZ] *= k;
return a;
}
-inline const LLVector3& operator*=(LLVector3 &a, const LLVector3 &b)
+inline const LLVector3& operator*=(LLVector3& a, const LLVector3& b)
{
- a.mV[0] *= b.mV[0];
- a.mV[1] *= b.mV[1];
- a.mV[2] *= b.mV[2];
+ a.mV[VX] *= b.mV[VX];
+ a.mV[VY] *= b.mV[VY];
+ a.mV[VZ] *= b.mV[VZ];
return a;
}
-inline const LLVector3& operator/=(LLVector3 &a, F32 k)
+inline const LLVector3& operator/=(LLVector3& a, F32 k)
{
- F32 t = 1.f / k;
- a.mV[0] *= t;
- a.mV[1] *= t;
- a.mV[2] *= t;
+ a *= 1.f / k;
return a;
}
-inline LLVector3 operator-(const LLVector3 &a)
+inline LLVector3 operator-(const LLVector3& a)
{
- return LLVector3( -a.mV[0], -a.mV[1], -a.mV[2] );
+ return LLVector3(-a.mV[VX], -a.mV[VY], -a.mV[VZ]);
}
inline LLVector3::operator glm::vec3() const
@@ -522,40 +472,37 @@ inline LLVector3::operator glm::vec4() const
return glm::vec4(mV[VX], mV[VY], mV[VZ], 1.f);
}
-inline F32 dist_vec(const LLVector3 &a, const LLVector3 &b)
+inline F32 dist_vec(const LLVector3& a, const LLVector3& b)
{
- F32 x = a.mV[0] - b.mV[0];
- F32 y = a.mV[1] - b.mV[1];
- F32 z = a.mV[2] - b.mV[2];
- return (F32) sqrt( x*x + y*y + z*z );
+ F32 x = a.mV[VX] - b.mV[VX];
+ F32 y = a.mV[VY] - b.mV[VY];
+ F32 z = a.mV[VZ] - b.mV[VZ];
+ return sqrt( x*x + y*y + z*z );
}
-inline F32 dist_vec_squared(const LLVector3 &a, const LLVector3 &b)
+inline F32 dist_vec_squared(const LLVector3& a, const LLVector3& b)
{
- F32 x = a.mV[0] - b.mV[0];
- F32 y = a.mV[1] - b.mV[1];
- F32 z = a.mV[2] - b.mV[2];
+ F32 x = a.mV[VX] - b.mV[VX];
+ F32 y = a.mV[VY] - b.mV[VY];
+ F32 z = a.mV[VZ] - b.mV[VZ];
return x*x + y*y + z*z;
}
-inline F32 dist_vec_squared2D(const LLVector3 &a, const LLVector3 &b)
+inline F32 dist_vec_squared2D(const LLVector3& a, const LLVector3& b)
{
- F32 x = a.mV[0] - b.mV[0];
- F32 y = a.mV[1] - b.mV[1];
+ F32 x = a.mV[VX] - b.mV[VX];
+ F32 y = a.mV[VY] - b.mV[VY];
return x*x + y*y;
}
-inline LLVector3 projected_vec(const LLVector3 &a, const LLVector3 &b)
+inline LLVector3 projected_vec(const LLVector3& a, const LLVector3& b)
{
F32 bb = b * b;
if (bb > FP_MAG_THRESHOLD * FP_MAG_THRESHOLD)
{
return ((a * b) / bb) * b;
}
- else
- {
- return b.zero;
- }
+ return b.zero;
}
inline LLVector3 inverse_projected_vec(const LLVector3& a, const LLVector3& b)
@@ -570,18 +517,18 @@ inline LLVector3 inverse_projected_vec(const LLVector3& a, const LLVector3& b)
return normalized_a * (b_length / dot_product);
}
-inline LLVector3 parallel_component(const LLVector3 &a, const LLVector3 &b)
+inline LLVector3 parallel_component(const LLVector3& a, const LLVector3& b)
{
return projected_vec(a, b);
}
-inline LLVector3 orthogonal_component(const LLVector3 &a, const LLVector3 &b)
+inline LLVector3 orthogonal_component(const LLVector3& a, const LLVector3& b)
{
return a - projected_vec(a, b);
}
-inline LLVector3 lerp(const LLVector3 &a, const LLVector3 &b, F32 u)
+inline LLVector3 lerp(const LLVector3& a, const LLVector3& b, F32 u)
{
return LLVector3(
a.mV[VX] + (b.mV[VX] - a.mV[VX]) * u,
@@ -592,11 +539,7 @@ inline LLVector3 lerp(const LLVector3 &a, const LLVector3 &b, F32 u)
inline bool LLVector3::isNull() const
{
- if ( F_APPROXIMATELY_ZERO > mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ] )
- {
- return true;
- }
- return false;
+ return F_APPROXIMATELY_ZERO > mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ];
}
inline void update_min_max(LLVector3& min, LLVector3& max, const LLVector3& pos)
@@ -637,17 +580,17 @@ inline F32 angle_between(const LLVector3& a, const LLVector3& b)
ab = 0.0f; // get rid of negative zero
}
LLVector3 c = a % b; // crossproduct
- return atan2f(sqrtf(c * c), ab); // return the angle
+ return atan2f(c.length(), ab); // return the angle
}
-inline bool are_parallel(const LLVector3 &a, const LLVector3 &b, F32 epsilon)
+inline bool are_parallel(const LLVector3& a, const LLVector3& b, F32 epsilon)
{
LLVector3 an = a;
LLVector3 bn = b;
an.normalize();
bn.normalize();
F32 dot = an * bn;
- if ( (1.0f - fabs(dot)) < epsilon)
+ if (1.0f - fabs(dot) < epsilon)
{
return true;
}
diff --git a/indra/llmath/v4color.cpp b/indra/llmath/v4color.cpp
index ad13656bbd..1b687642ca 100644
--- a/indra/llmath/v4color.cpp
+++ b/indra/llmath/v4color.cpp
@@ -124,65 +124,64 @@ LLColor4 LLColor4::cyan6(0.2f, 0.6f, 0.6f, 1.0f);
// conversion
LLColor4::operator LLColor4U() const
{
- return LLColor4U(
- (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)));
+ return LLColor4U((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)
+LLColor4::LLColor4(const LLColor3& vec, F32 a)
{
- mV[VRED] = vec.mV[VRED];
+ mV[VRED] = vec.mV[VRED];
mV[VGREEN] = vec.mV[VGREEN];
- mV[VBLUE] = vec.mV[VBLUE];
+ mV[VBLUE] = vec.mV[VBLUE];
mV[VALPHA] = a;
}
LLColor4::LLColor4(const LLColor4U& color4u)
{
- const F32 SCALE = 1.f/255.f;
- mV[VRED] = color4u.mV[VRED] * SCALE;
- mV[VGREEN] = color4u.mV[VGREEN] * SCALE;
- mV[VBLUE] = color4u.mV[VBLUE] * SCALE;
- mV[VALPHA] = color4u.mV[VALPHA] * SCALE;
+ constexpr F32 SCALE = 1.f / 255.f;
+ mV[VRED] = color4u.mV[VRED] * SCALE;
+ mV[VGREEN] = color4u.mV[VGREEN] * SCALE;
+ mV[VBLUE] = color4u.mV[VBLUE] * SCALE;
+ mV[VALPHA] = color4u.mV[VALPHA] * SCALE;
}
LLColor4::LLColor4(const LLVector4& vector4)
{
- mV[VRED] = vector4.mV[VRED];
+ mV[VRED] = vector4.mV[VRED];
mV[VGREEN] = vector4.mV[VGREEN];
- mV[VBLUE] = vector4.mV[VBLUE];
+ mV[VBLUE] = vector4.mV[VBLUE];
mV[VALPHA] = vector4.mV[VALPHA];
}
const LLColor4& LLColor4::set(const LLColor4U& color4u)
{
- const F32 SCALE = 1.f/255.f;
- mV[VRED] = color4u.mV[VRED] * SCALE;
- mV[VGREEN] = color4u.mV[VGREEN] * SCALE;
- mV[VBLUE] = color4u.mV[VBLUE] * SCALE;
- mV[VALPHA] = color4u.mV[VALPHA] * SCALE;
+ constexpr F32 SCALE = 1.f / 255.f;
+ mV[VRED] = color4u.mV[VRED] * SCALE;
+ mV[VGREEN] = color4u.mV[VGREEN] * SCALE;
+ mV[VBLUE] = color4u.mV[VBLUE] * SCALE;
+ mV[VALPHA] = color4u.mV[VALPHA] * SCALE;
return (*this);
}
-const LLColor4& LLColor4::set(const LLColor3 &vec)
+const LLColor4& LLColor4::set(const LLColor3& vec)
{
- mV[VRED] = vec.mV[VRED];
+ mV[VRED] = vec.mV[VRED];
mV[VGREEN] = vec.mV[VGREEN];
- mV[VBLUE] = vec.mV[VBLUE];
+ mV[VBLUE] = vec.mV[VBLUE];
-// no change to alpha!
-// mV[VALPHA] = 1.f;
+ // no change to alpha!
+ // mV[VALPHA] = 1.f;
return (*this);
}
-const LLColor4& LLColor4::set(const LLColor3 &vec, F32 a)
+const LLColor4& LLColor4::set(const LLColor3& vec, F32 a)
{
- mV[VRED] = vec.mV[VRED];
+ mV[VRED] = vec.mV[VRED];
mV[VGREEN] = vec.mV[VGREEN];
- mV[VBLUE] = vec.mV[VBLUE];
+ mV[VBLUE] = vec.mV[VBLUE];
mV[VALPHA] = a;
return (*this);
}
@@ -190,33 +189,33 @@ const LLColor4& LLColor4::set(const LLColor3 &vec, F32 a)
// deprecated -- use set()
const LLColor4& LLColor4::setVec(const LLColor4U& color4u)
{
- const F32 SCALE = 1.f/255.f;
- mV[VRED] = color4u.mV[VRED] * SCALE;
- mV[VGREEN] = color4u.mV[VGREEN] * SCALE;
- mV[VBLUE] = color4u.mV[VBLUE] * SCALE;
- mV[VALPHA] = color4u.mV[VALPHA] * SCALE;
+ constexpr F32 SCALE = 1.f / 255.f;
+ mV[VRED] = color4u.mV[VRED] * SCALE;
+ mV[VGREEN] = color4u.mV[VGREEN] * SCALE;
+ mV[VBLUE] = color4u.mV[VBLUE] * SCALE;
+ mV[VALPHA] = color4u.mV[VALPHA] * SCALE;
return (*this);
}
// deprecated -- use set()
-const LLColor4& LLColor4::setVec(const LLColor3 &vec)
+const LLColor4& LLColor4::setVec(const LLColor3& vec)
{
- mV[VRED] = vec.mV[VRED];
+ mV[VRED] = vec.mV[VRED];
mV[VGREEN] = vec.mV[VGREEN];
- mV[VBLUE] = vec.mV[VBLUE];
+ mV[VBLUE] = vec.mV[VBLUE];
-// no change to alpha!
-// mV[VALPHA] = 1.f;
+ // no change to alpha!
+ // mV[VALPHA] = 1.f;
return (*this);
}
// deprecated -- use set()
-const LLColor4& LLColor4::setVec(const LLColor3 &vec, F32 a)
+const LLColor4& LLColor4::setVec(const LLColor3& vec, F32 a)
{
- mV[VRED] = vec.mV[VRED];
+ mV[VRED] = vec.mV[VRED];
mV[VGREEN] = vec.mV[VGREEN];
- mV[VBLUE] = vec.mV[VBLUE];
+ mV[VBLUE] = vec.mV[VBLUE];
mV[VALPHA] = a;
return (*this);
}
@@ -228,110 +227,110 @@ void LLColor4::setValue(const LLSD& sd)
F32 val;
bool out_of_range = false;
val = sd[0].asReal();
- mV[0] = llclamp(val, 0.f, 1.f);
- out_of_range = mV[0] != val;
+ mV[VRED] = llclamp(val, 0.f, 1.f);
+ out_of_range = mV[VRED] != val;
val = sd[1].asReal();
- mV[1] = llclamp(val, 0.f, 1.f);
- out_of_range |= mV[1] != val;
+ mV[VGREEN] = llclamp(val, 0.f, 1.f);
+ out_of_range |= mV[VGREEN] != val;
val = sd[2].asReal();
- mV[2] = llclamp(val, 0.f, 1.f);
- out_of_range |= mV[2] != val;
+ mV[VBLUE] = llclamp(val, 0.f, 1.f);
+ out_of_range |= mV[VBLUE] != val;
val = sd[3].asReal();
- mV[3] = llclamp(val, 0.f, 1.f);
- out_of_range |= mV[3] != val;
+ mV[VALPHA] = llclamp(val, 0.f, 1.f);
+ out_of_range |= mV[VALPHA] != val;
if (out_of_range)
{
LL_WARNS() << "LLSD color value out of range!" << LL_ENDL;
}
#else
- mV[0] = (F32) sd[0].asReal();
- mV[1] = (F32) sd[1].asReal();
- mV[2] = (F32) sd[2].asReal();
- mV[3] = (F32) sd[3].asReal();
+ mV[VRED] = (F32)sd[VRED].asReal();
+ mV[VGREEN] = (F32)sd[VGREEN].asReal();
+ mV[VBLUE] = (F32)sd[VBLUE].asReal();
+ mV[VALPHA] = (F32)sd[VALPHA].asReal();
#endif
}
-const LLColor4& LLColor4::operator=(const LLColor3 &a)
+const LLColor4& LLColor4::operator=(const LLColor3& a)
{
- mV[VRED] = a.mV[VRED];
+ mV[VRED] = a.mV[VRED];
mV[VGREEN] = a.mV[VGREEN];
- mV[VBLUE] = a.mV[VBLUE];
+ mV[VBLUE] = a.mV[VBLUE];
-// converting from an rgb sets a=1 (opaque)
+ // converting from an rgb sets a=1 (opaque)
mV[VALPHA] = 1.f;
return (*this);
}
-
-std::ostream& operator<<(std::ostream& s, const LLColor4 &a)
+std::ostream& operator<<(std::ostream& s, const LLColor4& a)
{
s << "{ " << a.mV[VRED] << ", " << a.mV[VGREEN] << ", " << a.mV[VBLUE] << ", " << a.mV[VALPHA] << " }";
return s;
}
-bool operator==(const LLColor4 &a, const LLColor3 &b)
+bool operator==(const LLColor4& a, const LLColor3& b)
{
- return ( (a.mV[VRED] == b.mV[VRED])
- &&(a.mV[VGREEN] == b.mV[VGREEN])
- &&(a.mV[VBLUE] == b.mV[VBLUE]));
+ return ((a.mV[VRED] == b.mV[VRED]) && (a.mV[VGREEN] == b.mV[VGREEN]) && (a.mV[VBLUE] == b.mV[VBLUE]));
}
-bool operator!=(const LLColor4 &a, const LLColor3 &b)
+bool operator!=(const LLColor4& a, const LLColor3& b)
{
- return ( (a.mV[VRED] != b.mV[VRED])
- ||(a.mV[VGREEN] != b.mV[VGREEN])
- ||(a.mV[VBLUE] != b.mV[VBLUE]));
+ return ((a.mV[VRED] != b.mV[VRED]) || (a.mV[VGREEN] != b.mV[VGREEN]) || (a.mV[VBLUE] != b.mV[VBLUE]));
}
-LLColor3 vec4to3(const LLColor4 &vec)
+LLColor3 vec4to3(const LLColor4& vec)
{
- LLColor3 temp(vec.mV[VRED], vec.mV[VGREEN], vec.mV[VBLUE]);
+ LLColor3 temp(vec.mV[VRED], vec.mV[VGREEN], vec.mV[VBLUE]);
return temp;
}
-LLColor4 vec3to4(const LLColor3 &vec)
+LLColor4 vec3to4(const LLColor3& vec)
{
- LLColor3 temp(vec.mV[VRED], vec.mV[VGREEN], vec.mV[VBLUE]);
+ LLColor3 temp(vec.mV[VRED], vec.mV[VGREEN], vec.mV[VBLUE]);
return temp;
}
-static F32 hueToRgb ( F32 val1In, F32 val2In, F32 valHUeIn )
+static F32 hueToRgb(F32 val1In, F32 val2In, F32 valHUeIn)
{
- if ( valHUeIn < 0.0f ) valHUeIn += 1.0f;
- if ( valHUeIn > 1.0f ) valHUeIn -= 1.0f;
- if ( ( 6.0f * valHUeIn ) < 1.0f ) return ( val1In + ( val2In - val1In ) * 6.0f * valHUeIn );
- if ( ( 2.0f * valHUeIn ) < 1.0f ) return ( val2In );
- if ( ( 3.0f * valHUeIn ) < 2.0f ) return ( val1In + ( val2In - val1In ) * ( ( 2.0f / 3.0f ) - valHUeIn ) * 6.0f );
- return ( val1In );
+ if (valHUeIn < 0.0f)
+ valHUeIn += 1.0f;
+ if (valHUeIn > 1.0f)
+ valHUeIn -= 1.0f;
+ if ((6.0f * valHUeIn) < 1.0f)
+ return (val1In + (val2In - val1In) * 6.0f * valHUeIn);
+ if ((2.0f * valHUeIn) < 1.0f)
+ return (val2In);
+ if ((3.0f * valHUeIn) < 2.0f)
+ return (val1In + (val2In - val1In) * ((2.0f / 3.0f) - valHUeIn) * 6.0f);
+ return (val1In);
}
-void LLColor4::setHSL ( F32 hValIn, F32 sValIn, F32 lValIn)
+void LLColor4::setHSL(F32 hValIn, F32 sValIn, F32 lValIn)
{
- if ( sValIn < 0.00001f )
+ if (sValIn < 0.00001f)
{
- mV[VRED] = lValIn;
+ mV[VRED] = lValIn;
mV[VGREEN] = lValIn;
- mV[VBLUE] = lValIn;
+ mV[VBLUE] = lValIn;
}
else
{
F32 interVal1;
F32 interVal2;
- if ( lValIn < 0.5f )
- interVal2 = lValIn * ( 1.0f + sValIn );
+ if (lValIn < 0.5f)
+ interVal2 = lValIn * (1.0f + sValIn);
else
- interVal2 = ( lValIn + sValIn ) - ( sValIn * lValIn );
+ interVal2 = (lValIn + sValIn) - (sValIn * lValIn);
interVal1 = 2.0f * lValIn - interVal2;
- mV[VRED] = hueToRgb ( interVal1, interVal2, hValIn + ( 1.f / 3.f ) );
- mV[VGREEN] = hueToRgb ( interVal1, interVal2, hValIn );
- mV[VBLUE] = hueToRgb ( interVal1, interVal2, hValIn - ( 1.f / 3.f ) );
+ mV[VRED] = hueToRgb(interVal1, interVal2, hValIn + (1.f / 3.f));
+ mV[VGREEN] = hueToRgb(interVal1, interVal2, hValIn);
+ mV[VBLUE] = hueToRgb(interVal1, interVal2, hValIn - (1.f / 3.f));
}
}
@@ -341,58 +340,61 @@ void LLColor4::calcHSL(F32* hue, F32* saturation, F32* luminance) const
F32 var_G = mV[VGREEN];
F32 var_B = mV[VBLUE];
- F32 var_Min = ( var_R < ( var_G < var_B ? var_G : var_B ) ? var_R : ( var_G < var_B ? var_G : var_B ) );
- F32 var_Max = ( var_R > ( var_G > var_B ? var_G : var_B ) ? var_R : ( var_G > var_B ? var_G : var_B ) );
+ F32 var_Min = (var_R < (var_G < var_B ? var_G : var_B) ? var_R : (var_G < var_B ? var_G : var_B));
+ F32 var_Max = (var_R > (var_G > var_B ? var_G : var_B) ? var_R : (var_G > var_B ? var_G : var_B));
F32 del_Max = var_Max - var_Min;
- F32 L = ( var_Max + var_Min ) / 2.0f;
+ F32 L = (var_Max + var_Min) / 2.0f;
F32 H = 0.0f;
F32 S = 0.0f;
- if ( del_Max == 0.0f )
+ if (del_Max == 0.0f)
{
- H = 0.0f;
- S = 0.0f;
+ H = 0.0f;
+ S = 0.0f;
}
else
{
- if ( L < 0.5 )
- S = del_Max / ( var_Max + var_Min );
+ if (L < 0.5f)
+ S = del_Max / (var_Max + var_Min);
else
- S = del_Max / ( 2.0f - var_Max - var_Min );
+ S = del_Max / (2.0f - var_Max - var_Min);
- F32 del_R = ( ( ( var_Max - var_R ) / 6.0f ) + ( del_Max / 2.0f ) ) / del_Max;
- F32 del_G = ( ( ( var_Max - var_G ) / 6.0f ) + ( del_Max / 2.0f ) ) / del_Max;
- F32 del_B = ( ( ( var_Max - var_B ) / 6.0f ) + ( del_Max / 2.0f ) ) / del_Max;
+ F32 del_R = (((var_Max - var_R) / 6.0f) + (del_Max / 2.0f)) / del_Max;
+ F32 del_G = (((var_Max - var_G) / 6.0f) + (del_Max / 2.0f)) / del_Max;
+ F32 del_B = (((var_Max - var_B) / 6.0f) + (del_Max / 2.0f)) / del_Max;
- if ( var_R >= var_Max )
+ if (var_R >= var_Max)
H = del_B - del_G;
- else
- if ( var_G >= var_Max )
- H = ( 1.0f / 3.0f ) + del_R - del_B;
- else
- if ( var_B >= var_Max )
- H = ( 2.0f / 3.0f ) + del_G - del_R;
-
- if ( H < 0.0f ) H += 1.0f;
- if ( H > 1.0f ) H -= 1.0f;
+ else if (var_G >= var_Max)
+ H = (1.0f / 3.0f) + del_R - del_B;
+ else if (var_B >= var_Max)
+ H = (2.0f / 3.0f) + del_G - del_R;
+
+ if (H < 0.0f)
+ H += 1.0f;
+ if (H > 1.0f)
+ H -= 1.0f;
}
- if (hue) *hue = H;
- if (saturation) *saturation = S;
- if (luminance) *luminance = L;
+ if (hue)
+ *hue = H;
+ if (saturation)
+ *saturation = S;
+ if (luminance)
+ *luminance = L;
}
// static
bool LLColor4::parseColor(const std::string& buf, LLColor4* color)
{
- if( buf.empty() || color == nullptr)
+ if (buf.empty() || color == nullptr)
{
return false;
}
- boost_tokenizer tokens(buf, boost::char_separator<char>(", "));
+ boost_tokenizer tokens(buf, boost::char_separator<char>(", "));
boost_tokenizer::iterator token_iter = tokens.begin();
if (token_iter == tokens.end())
{
@@ -401,16 +403,16 @@ bool LLColor4::parseColor(const std::string& buf, LLColor4* color)
// Grab the first token into a string, since we don't know
// if this is a float or a color name.
- std::string color_name( (*token_iter) );
+ std::string color_name((*token_iter));
++token_iter;
if (token_iter != tokens.end())
{
// There are more tokens to read. This must be a vector.
LLColor4 v;
- LLStringUtil::convertToF32( color_name, v.mV[VRED] );
- LLStringUtil::convertToF32( *token_iter, v.mV[VGREEN] );
- v.mV[VBLUE] = 0.0f;
+ LLStringUtil::convertToF32(color_name, v.mV[VRED]);
+ LLStringUtil::convertToF32(*token_iter, v.mV[VGREEN]);
+ v.mV[VBLUE] = 0.0f;
v.mV[VALPHA] = 1.0f;
++token_iter;
@@ -422,283 +424,284 @@ bool LLColor4::parseColor(const std::string& buf, LLColor4* color)
else
{
// There is a z-component.
- LLStringUtil::convertToF32( *token_iter, v.mV[VBLUE] );
+ LLStringUtil::convertToF32(*token_iter, v.mV[VBLUE]);
++token_iter;
if (token_iter != tokens.end())
{
// There is an alpha component.
- LLStringUtil::convertToF32( *token_iter, v.mV[VALPHA] );
+ LLStringUtil::convertToF32(*token_iter, v.mV[VALPHA]);
}
}
// Make sure all values are between 0 and 1.
if (v.mV[VRED] > 1.f || v.mV[VGREEN] > 1.f || v.mV[VBLUE] > 1.f || v.mV[VALPHA] > 1.f)
{
- v = v * (1.f / 255.f);
+ constexpr F32 SCALE{ 1.f / 255.f };
+ v *= SCALE;
}
- color->set( v );
+ color->set(v);
}
else // Single value. Read as a named color.
{
// We have a color name
- if ( "red" == color_name )
+ if ("red" == color_name)
{
color->set(LLColor4::red);
}
- else if ( "red1" == color_name )
+ else if ("red1" == color_name)
{
color->set(LLColor4::red1);
}
- else if ( "red2" == color_name )
+ else if ("red2" == color_name)
{
color->set(LLColor4::red2);
}
- else if ( "red3" == color_name )
+ else if ("red3" == color_name)
{
color->set(LLColor4::red3);
}
- else if ( "red4" == color_name )
+ else if ("red4" == color_name)
{
color->set(LLColor4::red4);
}
- else if ( "red5" == color_name )
+ else if ("red5" == color_name)
{
color->set(LLColor4::red5);
}
- else if( "green" == color_name )
+ else if ("green" == color_name)
{
color->set(LLColor4::green);
}
- else if( "green1" == color_name )
+ else if ("green1" == color_name)
{
color->set(LLColor4::green1);
}
- else if( "green2" == color_name )
+ else if ("green2" == color_name)
{
color->set(LLColor4::green2);
}
- else if( "green3" == color_name )
+ else if ("green3" == color_name)
{
color->set(LLColor4::green3);
}
- else if( "green4" == color_name )
+ else if ("green4" == color_name)
{
color->set(LLColor4::green4);
}
- else if( "green5" == color_name )
+ else if ("green5" == color_name)
{
color->set(LLColor4::green5);
}
- else if( "green6" == color_name )
+ else if ("green6" == color_name)
{
color->set(LLColor4::green6);
}
- else if( "blue" == color_name )
+ else if ("blue" == color_name)
{
color->set(LLColor4::blue);
}
- else if( "blue1" == color_name )
+ else if ("blue1" == color_name)
{
color->set(LLColor4::blue1);
}
- else if( "blue2" == color_name )
+ else if ("blue2" == color_name)
{
color->set(LLColor4::blue2);
}
- else if( "blue3" == color_name )
+ else if ("blue3" == color_name)
{
color->set(LLColor4::blue3);
}
- else if( "blue4" == color_name )
+ else if ("blue4" == color_name)
{
color->set(LLColor4::blue4);
}
- else if( "blue5" == color_name )
+ else if ("blue5" == color_name)
{
color->set(LLColor4::blue5);
}
- else if( "blue6" == color_name )
+ else if ("blue6" == color_name)
{
color->set(LLColor4::blue6);
}
- else if( "black" == color_name )
+ else if ("black" == color_name)
{
color->set(LLColor4::black);
}
- else if( "white" == color_name )
+ else if ("white" == color_name)
{
color->set(LLColor4::white);
}
- else if( "yellow" == color_name )
+ else if ("yellow" == color_name)
{
color->set(LLColor4::yellow);
}
- else if( "yellow1" == color_name )
+ else if ("yellow1" == color_name)
{
color->set(LLColor4::yellow1);
}
- else if( "yellow2" == color_name )
+ else if ("yellow2" == color_name)
{
color->set(LLColor4::yellow2);
}
- else if( "yellow3" == color_name )
+ else if ("yellow3" == color_name)
{
color->set(LLColor4::yellow3);
}
- else if( "yellow4" == color_name )
+ else if ("yellow4" == color_name)
{
color->set(LLColor4::yellow4);
}
- else if( "yellow5" == color_name )
+ else if ("yellow5" == color_name)
{
color->set(LLColor4::yellow5);
}
- else if( "yellow6" == color_name )
+ else if ("yellow6" == color_name)
{
color->set(LLColor4::yellow6);
}
- else if( "magenta" == color_name )
+ else if ("magenta" == color_name)
{
color->set(LLColor4::magenta);
}
- else if( "magenta1" == color_name )
+ else if ("magenta1" == color_name)
{
color->set(LLColor4::magenta1);
}
- else if( "magenta2" == color_name )
+ else if ("magenta2" == color_name)
{
color->set(LLColor4::magenta2);
}
- else if( "magenta3" == color_name )
+ else if ("magenta3" == color_name)
{
color->set(LLColor4::magenta3);
}
- else if( "magenta4" == color_name )
+ else if ("magenta4" == color_name)
{
color->set(LLColor4::magenta4);
}
- else if( "purple" == color_name )
+ else if ("purple" == color_name)
{
color->set(LLColor4::purple);
}
- else if( "purple1" == color_name )
+ else if ("purple1" == color_name)
{
color->set(LLColor4::purple1);
}
- else if( "purple2" == color_name )
+ else if ("purple2" == color_name)
{
color->set(LLColor4::purple2);
}
- else if( "purple3" == color_name )
+ else if ("purple3" == color_name)
{
color->set(LLColor4::purple3);
}
- else if( "purple4" == color_name )
+ else if ("purple4" == color_name)
{
color->set(LLColor4::purple4);
}
- else if( "purple5" == color_name )
+ else if ("purple5" == color_name)
{
color->set(LLColor4::purple5);
}
- else if( "purple6" == color_name )
+ else if ("purple6" == color_name)
{
color->set(LLColor4::purple6);
}
- else if( "pink" == color_name )
+ else if ("pink" == color_name)
{
color->set(LLColor4::pink);
}
- else if( "pink1" == color_name )
+ else if ("pink1" == color_name)
{
color->set(LLColor4::pink1);
}
- else if( "pink2" == color_name )
+ else if ("pink2" == color_name)
{
color->set(LLColor4::pink2);
}
- else if( "cyan" == color_name )
+ else if ("cyan" == color_name)
{
color->set(LLColor4::cyan);
}
- else if( "cyan1" == color_name )
+ else if ("cyan1" == color_name)
{
color->set(LLColor4::cyan1);
}
- else if( "cyan2" == color_name )
+ else if ("cyan2" == color_name)
{
color->set(LLColor4::cyan2);
}
- else if( "cyan3" == color_name )
+ else if ("cyan3" == color_name)
{
color->set(LLColor4::cyan3);
}
- else if( "cyan4" == color_name )
+ else if ("cyan4" == color_name)
{
color->set(LLColor4::cyan4);
}
- else if( "cyan5" == color_name )
+ else if ("cyan5" == color_name)
{
color->set(LLColor4::cyan5);
}
- else if( "cyan6" == color_name )
+ else if ("cyan6" == color_name)
{
color->set(LLColor4::cyan6);
}
- else if( "smoke" == color_name )
+ else if ("smoke" == color_name)
{
color->set(LLColor4::smoke);
}
- else if( "grey" == color_name )
+ else if ("grey" == color_name)
{
color->set(LLColor4::grey);
}
- else if( "grey1" == color_name )
+ else if ("grey1" == color_name)
{
color->set(LLColor4::grey1);
}
- else if( "grey2" == color_name )
+ else if ("grey2" == color_name)
{
color->set(LLColor4::grey2);
}
- else if( "grey3" == color_name )
+ else if ("grey3" == color_name)
{
color->set(LLColor4::grey3);
}
- else if( "grey4" == color_name )
+ else if ("grey4" == color_name)
{
color->set(LLColor4::grey4);
}
- else if( "orange" == color_name )
+ else if ("orange" == color_name)
{
color->set(LLColor4::orange);
}
- else if( "orange1" == color_name )
+ else if ("orange1" == color_name)
{
color->set(LLColor4::orange1);
}
- else if( "orange2" == color_name )
+ else if ("orange2" == color_name)
{
color->set(LLColor4::orange2);
}
- else if( "orange3" == color_name )
+ else if ("orange3" == color_name)
{
color->set(LLColor4::orange3);
}
- else if( "orange4" == color_name )
+ else if ("orange4" == color_name)
{
color->set(LLColor4::orange4);
}
- else if( "orange5" == color_name )
+ else if ("orange5" == color_name)
{
color->set(LLColor4::orange5);
}
- else if( "orange6" == color_name )
+ else if ("orange6" == color_name)
{
color->set(LLColor4::orange6);
}
- else if ( "clear" == color_name )
+ else if ("clear" == color_name)
{
color->set(0.f, 0.f, 0.f, 0.f);
}
@@ -714,21 +717,21 @@ bool LLColor4::parseColor(const std::string& buf, LLColor4* color)
// static
bool LLColor4::parseColor4(const std::string& buf, LLColor4* value)
{
- if( buf.empty() || value == nullptr)
+ if (buf.empty() || value == nullptr)
{
return false;
}
LLColor4 v;
- S32 count = sscanf( buf.c_str(), "%f, %f, %f, %f", v.mV + 0, v.mV + 1, v.mV + 2, v.mV + 3 );
- if (1 == count )
+ S32 count = sscanf(buf.c_str(), "%f, %f, %f, %f", v.mV + 0, v.mV + 1, v.mV + 2, v.mV + 3);
+ if (1 == count)
{
// try this format
- count = sscanf( buf.c_str(), "%f %f %f %f", v.mV + 0, v.mV + 1, v.mV + 2, v.mV + 3 );
+ count = sscanf(buf.c_str(), "%f %f %f %f", v.mV + 0, v.mV + 1, v.mV + 2, v.mV + 3);
}
- if( 4 == count )
+ if (4 == count)
{
- value->setVec( v );
+ value->setVec(v);
return true;
}
diff --git a/indra/llmath/v4color.h b/indra/llmath/v4color.h
index cafdbd9d7c..2f1cb21113 100644
--- a/indra/llmath/v4color.h
+++ b/indra/llmath/v4color.h
@@ -28,7 +28,6 @@
#define LL_V4COLOR_H
#include "llerror.h"
-//#include "vmath.h"
#include "llmath.h"
#include "llsd.h"
@@ -38,213 +37,212 @@ class LLVector4;
// LLColor4 = |x y z w|
-static const U32 LENGTHOFCOLOR4 = 4;
+static constexpr U32 LENGTHOFCOLOR4 = 4;
-static const U32 MAX_LENGTH_OF_COLOR_NAME = 15; //Give plenty of room for additional colors...
+static constexpr U32 MAX_LENGTH_OF_COLOR_NAME = 15; // Give plenty of room for additional colors...
class LLColor4
{
- public:
- F32 mV[LENGTHOFCOLOR4];
- LLColor4(); // Initializes LLColor4 to (0, 0, 0, 1)
- LLColor4(F32 r, F32 g, F32 b); // Initializes LLColor4 to (r, g, b, 1)
- LLColor4(F32 r, F32 g, F32 b, F32 a); // Initializes LLColor4 to (r. g, b, a)
- LLColor4(const LLColor3 &vec, F32 a = 1.f); // Initializes LLColor4 to (vec, a)
- explicit LLColor4(const LLSD& sd);
- explicit LLColor4(const F32 *vec); // Initializes LLColor4 to (vec[0]. vec[1], vec[2], 1)
- explicit LLColor4(U32 clr); // Initializes LLColor4 to (r=clr>>24, etc))
- explicit LLColor4(const LLColor4U& color4u); // "explicit" to avoid automatic conversion
- explicit LLColor4(const LLVector4& vector4); // "explicit" to avoid automatic conversion
-
- LLSD getValue() const
- {
- LLSD ret;
- ret[0] = mV[0];
- ret[1] = mV[1];
- ret[2] = mV[2];
- ret[3] = mV[3];
- return ret;
- }
-
- void setValue(const LLSD& sd);
-
- void setHSL(F32 hue, F32 saturation, F32 luminance);
- void calcHSL(F32* hue, F32* saturation, F32* luminance) const;
-
- const LLColor4& setToBlack(); // zero LLColor4 to (0, 0, 0, 1)
- const LLColor4& setToWhite(); // zero LLColor4 to (0, 0, 0, 1)
-
- const LLColor4& setVec(F32 r, F32 g, F32 b, F32 a); // deprecated -- use set()
- const LLColor4& setVec(F32 r, F32 g, F32 b); // deprecated -- use set()
- const LLColor4& setVec(const LLColor4 &vec); // deprecated -- use set()
- const LLColor4& setVec(const LLColor3 &vec); // deprecated -- use set()
- const LLColor4& setVec(const LLColor3 &vec, F32 a); // deprecated -- use set()
- const LLColor4& setVec(const F32 *vec); // deprecated -- use set()
- const LLColor4& setVec(const LLColor4U& color4u); // deprecated -- use set()
-
- const LLColor4& set(F32 r, F32 g, F32 b, F32 a); // Sets LLColor4 to (r, g, b, a)
- const LLColor4& set(F32 r, F32 g, F32 b); // Sets LLColor4 to (r, g, b) (no change in a)
- const LLColor4& set(const LLColor4 &vec); // Sets LLColor4 to vec
- const LLColor4& set(const LLColor3 &vec); // Sets LLColor4 to LLColor3 vec (no change in alpha)
- const LLColor4& set(const LLColor3 &vec, F32 a); // Sets LLColor4 to LLColor3 vec, with alpha specified
- const LLColor4& set(const F32 *vec); // Sets LLColor4 to vec
- const LLColor4& set(const F64 *vec); // Sets LLColor4 to (double)vec
- const LLColor4& set(const LLColor4U& color4u); // Sets LLColor4 to color4u, rescaled.
-
- // set from a vector of unknown type and size
- // may leave some data unmodified
- template<typename T>
- const LLColor4& set(const std::vector<T>& v);
-
- // write to a vector of unknown type and size
- // maye leave some data unmodified
- template<typename T>
- void write(std::vector<T>& v) const;
-
- const LLColor4& setAlpha(F32 a);
-
- F32 magVec() const; // deprecated -- use length()
- F32 magVecSquared() const; // deprecated -- use lengthSquared()
- F32 normVec(); // deprecated -- use normalize()
-
- F32 length() const; // Returns magnitude of LLColor4
- F32 lengthSquared() const; // Returns magnitude squared of LLColor4
- F32 normalize(); // deprecated -- use normalize()
-
- bool isOpaque() { return mV[VALPHA] == 1.f; }
-
- F32 operator[](int idx) const { return mV[idx]; }
- F32 &operator[](int idx) { return mV[idx]; }
-
- const LLColor4& operator=(const LLColor3 &a); // Assigns vec3 to vec4 and returns vec4
-
- bool operator<(const LLColor4& rhs) const;
- friend std::ostream& operator<<(std::ostream& s, const LLColor4 &a); // Print a
- friend LLColor4 operator+(const LLColor4 &a, const LLColor4 &b); // Return vector a + b
- friend LLColor4 operator-(const LLColor4 &a, const LLColor4 &b); // Return vector a minus b
- friend LLColor4 operator*(const LLColor4 &a, const LLColor4 &b); // Return component wise a * b
- friend LLColor4 operator*(const LLColor4 &a, F32 k); // Return rgb times scaler k (no alpha change)
- friend LLColor4 operator/(const LLColor4 &a, F32 k); // Return rgb divided by scalar k (no alpha change)
- friend LLColor4 operator*(F32 k, const LLColor4 &a); // Return rgb times scaler k (no alpha change)
- friend LLColor4 operator%(const LLColor4 &a, F32 k); // Return alpha times scaler k (no rgb change)
- friend LLColor4 operator%(F32 k, const LLColor4 &a); // Return alpha times scaler k (no rgb change)
-
- friend bool operator==(const LLColor4 &a, const LLColor4 &b); // Return a == b
- friend bool operator!=(const LLColor4 &a, const LLColor4 &b); // Return a != b
-
- friend bool operator==(const LLColor4 &a, const LLColor3 &b); // Return a == b
- friend bool operator!=(const LLColor4 &a, const LLColor3 &b); // Return a != b
-
- friend const LLColor4& operator+=(LLColor4 &a, const LLColor4 &b); // Return vector a + b
- friend const LLColor4& operator-=(LLColor4 &a, const LLColor4 &b); // Return vector a minus b
- friend const LLColor4& operator*=(LLColor4 &a, F32 k); // Return rgb times scaler k (no alpha change)
- friend const LLColor4& operator%=(LLColor4 &a, F32 k); // Return alpha times scaler k (no rgb change)
-
- friend const LLColor4& operator*=(LLColor4 &a, const LLColor4 &b); // Doesn't multiply alpha! (for lighting)
-
- // conversion
- operator LLColor4U() const;
-
- // Basic color values.
- static LLColor4 red;
- static LLColor4 green;
- static LLColor4 blue;
- static LLColor4 black;
- static LLColor4 white;
- static LLColor4 yellow;
- static LLColor4 magenta;
- static LLColor4 cyan;
- static LLColor4 smoke;
- static LLColor4 grey;
- static LLColor4 orange;
- static LLColor4 purple;
- static LLColor4 pink;
- static LLColor4 transparent;
-
- // Extra color values.
- static LLColor4 grey1;
- static LLColor4 grey2;
- static LLColor4 grey3;
- static LLColor4 grey4;
-
- static LLColor4 red1;
- static LLColor4 red2;
- static LLColor4 red3;
- static LLColor4 red4;
- static LLColor4 red5;
-
- static LLColor4 green1;
- static LLColor4 green2;
- static LLColor4 green3;
- static LLColor4 green4;
- static LLColor4 green5;
- static LLColor4 green6;
-
- static LLColor4 blue1;
- static LLColor4 blue2;
- static LLColor4 blue3;
- static LLColor4 blue4;
- static LLColor4 blue5;
- static LLColor4 blue6;
-
- static LLColor4 yellow1;
- static LLColor4 yellow2;
- static LLColor4 yellow3;
- static LLColor4 yellow4;
- static LLColor4 yellow5;
- static LLColor4 yellow6;
- static LLColor4 yellow7;
- static LLColor4 yellow8;
- static LLColor4 yellow9;
-
- static LLColor4 orange1;
- static LLColor4 orange2;
- static LLColor4 orange3;
- static LLColor4 orange4;
- static LLColor4 orange5;
- static LLColor4 orange6;
-
- static LLColor4 magenta1;
- static LLColor4 magenta2;
- static LLColor4 magenta3;
- static LLColor4 magenta4;
-
- static LLColor4 purple1;
- static LLColor4 purple2;
- static LLColor4 purple3;
- static LLColor4 purple4;
- static LLColor4 purple5;
- static LLColor4 purple6;
-
- static LLColor4 pink1;
- static LLColor4 pink2;
-
- static LLColor4 cyan1;
- static LLColor4 cyan2;
- static LLColor4 cyan3;
- static LLColor4 cyan4;
- static LLColor4 cyan5;
- static LLColor4 cyan6;
-
- static bool parseColor(const std::string& buf, LLColor4* color);
- static bool parseColor4(const std::string& buf, LLColor4* color);
-
- inline void clamp();
-};
+public:
+ F32 mV[LENGTHOFCOLOR4];
+ LLColor4(); // Initializes LLColor4 to (0, 0, 0, 1)
+ LLColor4(F32 r, F32 g, F32 b); // Initializes LLColor4 to (r, g, b, 1)
+ LLColor4(F32 r, F32 g, F32 b, F32 a); // Initializes LLColor4 to (r. g, b, a)
+ LLColor4(const LLColor3& vec, F32 a = 1.f); // Initializes LLColor4 to (vec, a)
+ explicit LLColor4(const LLSD& sd);
+ explicit LLColor4(const F32* vec); // Initializes LLColor4 to (vec[0]. vec[1], vec[2], 1)
+ explicit LLColor4(U32 clr); // Initializes LLColor4 to (r=clr>>24, etc))
+ explicit LLColor4(const LLColor4U& color4u); // "explicit" to avoid automatic conversion
+ explicit LLColor4(const LLVector4& vector4); // "explicit" to avoid automatic conversion
+
+ LLSD getValue() const
+ {
+ LLSD ret;
+ ret[VRED] = mV[VRED];
+ ret[VGREEN] = mV[VGREEN];
+ ret[VBLUE] = mV[VBLUE];
+ ret[VALPHA] = mV[VALPHA];
+ return ret;
+ }
+ void setValue(const LLSD& sd);
+
+ void setHSL(F32 hue, F32 saturation, F32 luminance);
+ void calcHSL(F32* hue, F32* saturation, F32* luminance) const;
+
+ const LLColor4& setToBlack(); // zero LLColor4 to (0, 0, 0, 1)
+ const LLColor4& setToWhite(); // zero LLColor4 to (0, 0, 0, 1)
+
+ const LLColor4& setVec(F32 r, F32 g, F32 b, F32 a); // deprecated -- use set()
+ const LLColor4& setVec(F32 r, F32 g, F32 b); // deprecated -- use set()
+ const LLColor4& setVec(const LLColor4& vec); // deprecated -- use set()
+ const LLColor4& setVec(const LLColor3& vec); // deprecated -- use set()
+ const LLColor4& setVec(const LLColor3& vec, F32 a); // deprecated -- use set()
+ const LLColor4& setVec(const F32* vec); // deprecated -- use set()
+ const LLColor4& setVec(const LLColor4U& color4u); // deprecated -- use set()
+
+ const LLColor4& set(F32 r, F32 g, F32 b, F32 a); // Sets LLColor4 to (r, g, b, a)
+ const LLColor4& set(F32 r, F32 g, F32 b); // Sets LLColor4 to (r, g, b) (no change in a)
+ const LLColor4& set(const LLColor4& vec); // Sets LLColor4 to vec
+ const LLColor4& set(const LLColor3& vec); // Sets LLColor4 to LLColor3 vec (no change in alpha)
+ const LLColor4& set(const LLColor3& vec, F32 a); // Sets LLColor4 to LLColor3 vec, with alpha specified
+ const LLColor4& set(const F32* vec); // Sets LLColor4 to vec
+ const LLColor4& set(const F64* vec); // Sets LLColor4 to (double)vec
+ const LLColor4& set(const LLColor4U& color4u); // Sets LLColor4 to color4u, rescaled.
+
+ // set from a vector of unknown type and size
+ // may leave some data unmodified
+ template<typename T>
+ const LLColor4& set(const std::vector<T>& v);
+
+ // write to a vector of unknown type and size
+ // maye leave some data unmodified
+ template<typename T>
+ void write(std::vector<T>& v) const;
+
+ const LLColor4& setAlpha(F32 a);
+
+ F32 magVec() const; // deprecated -- use length()
+ F32 magVecSquared() const; // deprecated -- use lengthSquared()
+ F32 normVec(); // deprecated -- use normalize()
+
+ F32 length() const; // Returns magnitude of LLColor4
+ F32 lengthSquared() const; // Returns magnitude squared of LLColor4
+ F32 normalize(); // deprecated -- use normalize()
+
+ bool isOpaque() const { return mV[VALPHA] == 1.f; }
+
+ F32 operator[](int idx) const { return mV[idx]; }
+ F32& operator[](int idx) { return mV[idx]; }
+
+ const LLColor4& operator=(const LLColor3& a); // Assigns vec3 to vec4 and returns vec4
+
+ bool operator<(const LLColor4& rhs) const;
+ friend std::ostream& operator<<(std::ostream& s, const LLColor4& a); // Print a
+ friend LLColor4 operator+(const LLColor4& a, const LLColor4& b); // Return vector a + b
+ friend LLColor4 operator-(const LLColor4& a, const LLColor4& b); // Return vector a minus b
+ friend LLColor4 operator*(const LLColor4& a, const LLColor4& b); // Return component wise a * b
+ friend LLColor4 operator*(const LLColor4& a, F32 k); // Return rgb times scaler k (no alpha change)
+ friend LLColor4 operator/(const LLColor4& a, F32 k); // Return rgb divided by scalar k (no alpha change)
+ friend LLColor4 operator*(F32 k, const LLColor4& a); // Return rgb times scaler k (no alpha change)
+ friend LLColor4 operator%(const LLColor4& a, F32 k); // Return alpha times scaler k (no rgb change)
+ friend LLColor4 operator%(F32 k, const LLColor4& a); // Return alpha times scaler k (no rgb change)
+
+ friend bool operator==(const LLColor4& a, const LLColor4& b); // Return a == b
+ friend bool operator!=(const LLColor4& a, const LLColor4& b); // Return a != b
+
+ friend bool operator==(const LLColor4& a, const LLColor3& b); // Return a == b
+ friend bool operator!=(const LLColor4& a, const LLColor3& b); // Return a != b
+
+ friend const LLColor4& operator+=(LLColor4& a, const LLColor4& b); // Return vector a + b
+ friend const LLColor4& operator-=(LLColor4& a, const LLColor4& b); // Return vector a minus b
+ friend const LLColor4& operator*=(LLColor4& a, F32 k); // Return rgb times scaler k (no alpha change)
+ friend const LLColor4& operator%=(LLColor4& a, F32 k); // Return alpha times scaler k (no rgb change)
+
+ friend const LLColor4& operator*=(LLColor4& a, const LLColor4& b); // Doesn't multiply alpha! (for lighting)
+
+ // conversion
+ operator LLColor4U() const;
+
+ // Basic color values.
+ static LLColor4 red;
+ static LLColor4 green;
+ static LLColor4 blue;
+ static LLColor4 black;
+ static LLColor4 white;
+ static LLColor4 yellow;
+ static LLColor4 magenta;
+ static LLColor4 cyan;
+ static LLColor4 smoke;
+ static LLColor4 grey;
+ static LLColor4 orange;
+ static LLColor4 purple;
+ static LLColor4 pink;
+ static LLColor4 transparent;
+
+ // Extra color values.
+ static LLColor4 grey1;
+ static LLColor4 grey2;
+ static LLColor4 grey3;
+ static LLColor4 grey4;
+
+ static LLColor4 red1;
+ static LLColor4 red2;
+ static LLColor4 red3;
+ static LLColor4 red4;
+ static LLColor4 red5;
+
+ static LLColor4 green1;
+ static LLColor4 green2;
+ static LLColor4 green3;
+ static LLColor4 green4;
+ static LLColor4 green5;
+ static LLColor4 green6;
+
+ static LLColor4 blue1;
+ static LLColor4 blue2;
+ static LLColor4 blue3;
+ static LLColor4 blue4;
+ static LLColor4 blue5;
+ static LLColor4 blue6;
+
+ static LLColor4 yellow1;
+ static LLColor4 yellow2;
+ static LLColor4 yellow3;
+ static LLColor4 yellow4;
+ static LLColor4 yellow5;
+ static LLColor4 yellow6;
+ static LLColor4 yellow7;
+ static LLColor4 yellow8;
+ static LLColor4 yellow9;
+
+ static LLColor4 orange1;
+ static LLColor4 orange2;
+ static LLColor4 orange3;
+ static LLColor4 orange4;
+ static LLColor4 orange5;
+ static LLColor4 orange6;
+
+ static LLColor4 magenta1;
+ static LLColor4 magenta2;
+ static LLColor4 magenta3;
+ static LLColor4 magenta4;
+
+ static LLColor4 purple1;
+ static LLColor4 purple2;
+ static LLColor4 purple3;
+ static LLColor4 purple4;
+ static LLColor4 purple5;
+ static LLColor4 purple6;
+
+ static LLColor4 pink1;
+ static LLColor4 pink2;
+
+ static LLColor4 cyan1;
+ static LLColor4 cyan2;
+ static LLColor4 cyan3;
+ static LLColor4 cyan4;
+ static LLColor4 cyan5;
+ static LLColor4 cyan6;
+
+ static bool parseColor(const std::string& buf, LLColor4* color);
+ static bool parseColor4(const std::string& buf, LLColor4* color);
+
+ inline void clamp();
+};
// Non-member functions
-F32 distVec(const LLColor4 &a, const LLColor4 &b); // Returns distance between a and b
-F32 distVec_squared(const LLColor4 &a, const LLColor4 &b); // Returns distance squared between a and b
-LLColor3 vec4to3(const LLColor4 &vec);
-LLColor4 vec3to4(const LLColor3 &vec);
-LLColor4 lerp(const LLColor4 &a, const LLColor4 &b, F32 u);
+F32 distVec(const LLColor4& a, const LLColor4& b); // Returns distance between a and b
+F32 distVec_squared(const LLColor4& a, const LLColor4& b); // Returns distance squared between a and b
+LLColor3 vec4to3(const LLColor4& vec);
+LLColor4 vec3to4(const LLColor3& vec);
+LLColor4 lerp(const LLColor4& a, const LLColor4& b, F32 u);
-inline LLColor4::LLColor4(void)
+inline LLColor4::LLColor4()
{
- mV[VRED] = 0.f;
+ mV[VRED] = 0.f;
mV[VGREEN] = 0.f;
- mV[VBLUE] = 0.f;
+ mV[VBLUE] = 0.f;
mV[VALPHA] = 1.f;
}
@@ -255,149 +253,146 @@ inline LLColor4::LLColor4(const LLSD& sd)
inline LLColor4::LLColor4(F32 r, F32 g, F32 b)
{
- mV[VRED] = r;
+ mV[VRED] = r;
mV[VGREEN] = g;
- mV[VBLUE] = b;
+ mV[VBLUE] = b;
mV[VALPHA] = 1.f;
}
inline LLColor4::LLColor4(F32 r, F32 g, F32 b, F32 a)
{
- mV[VRED] = r;
+ mV[VRED] = r;
mV[VGREEN] = g;
- mV[VBLUE] = b;
+ mV[VBLUE] = b;
mV[VALPHA] = a;
}
inline LLColor4::LLColor4(U32 clr)
{
- mV[VRED] = (clr&0xff) * (1.0f/255.0f);
- mV[VGREEN] = ((clr>>8)&0xff) * (1.0f/255.0f);
- mV[VBLUE] = ((clr>>16)&0xff) * (1.0f/255.0f);
- mV[VALPHA] = (clr>>24) * (1.0f/255.0f);
+ mV[VRED] = (clr & 0xff) * (1.0f / 255.0f);
+ mV[VGREEN] = ((clr >> 8) & 0xff) * (1.0f / 255.0f);
+ mV[VBLUE] = ((clr >> 16) & 0xff) * (1.0f / 255.0f);
+ mV[VALPHA] = (clr >> 24) * (1.0f / 255.0f);
}
-
-inline LLColor4::LLColor4(const F32 *vec)
+inline LLColor4::LLColor4(const F32* vec)
{
- mV[VRED] = vec[VRED];
+ mV[VRED] = vec[VRED];
mV[VGREEN] = vec[VGREEN];
- mV[VBLUE] = vec[VBLUE];
+ mV[VBLUE] = vec[VBLUE];
mV[VALPHA] = vec[VALPHA];
}
-inline const LLColor4& LLColor4::setToBlack(void)
+inline const LLColor4& LLColor4::setToBlack(void)
{
- mV[VRED] = 0.f;
+ mV[VRED] = 0.f;
mV[VGREEN] = 0.f;
- mV[VBLUE] = 0.f;
+ mV[VBLUE] = 0.f;
mV[VALPHA] = 1.f;
return (*this);
}
-inline const LLColor4& LLColor4::setToWhite(void)
+inline const LLColor4& LLColor4::setToWhite(void)
{
- mV[VRED] = 1.f;
+ mV[VRED] = 1.f;
mV[VGREEN] = 1.f;
- mV[VBLUE] = 1.f;
+ mV[VBLUE] = 1.f;
mV[VALPHA] = 1.f;
return (*this);
}
-inline const LLColor4& LLColor4::set(F32 x, F32 y, F32 z)
+inline const LLColor4& LLColor4::set(F32 x, F32 y, F32 z)
{
- mV[VRED] = x;
+ mV[VRED] = x;
mV[VGREEN] = y;
- mV[VBLUE] = z;
+ mV[VBLUE] = z;
-// no change to alpha!
-// mV[VALPHA] = 1.f;
+ // no change to alpha!
+ // mV[VALPHA] = 1.f;
return (*this);
}
-inline const LLColor4& LLColor4::set(F32 x, F32 y, F32 z, F32 a)
+inline const LLColor4& LLColor4::set(F32 x, F32 y, F32 z, F32 a)
{
- mV[VRED] = x;
+ mV[VRED] = x;
mV[VGREEN] = y;
- mV[VBLUE] = z;
+ mV[VBLUE] = z;
mV[VALPHA] = a;
return (*this);
}
-inline const LLColor4& LLColor4::set(const LLColor4 &vec)
+inline const LLColor4& LLColor4::set(const LLColor4& vec)
{
- mV[VRED] = vec.mV[VRED];
+ mV[VRED] = vec.mV[VRED];
mV[VGREEN] = vec.mV[VGREEN];
- mV[VBLUE] = vec.mV[VBLUE];
+ mV[VBLUE] = vec.mV[VBLUE];
mV[VALPHA] = vec.mV[VALPHA];
return (*this);
}
-
-inline const LLColor4& LLColor4::set(const F32 *vec)
+inline const LLColor4& LLColor4::set(const F32* vec)
{
- mV[VRED] = vec[VRED];
+ mV[VRED] = vec[VRED];
mV[VGREEN] = vec[VGREEN];
- mV[VBLUE] = vec[VBLUE];
+ mV[VBLUE] = vec[VBLUE];
mV[VALPHA] = vec[VALPHA];
return (*this);
}
-inline const LLColor4& LLColor4::set(const F64 *vec)
+inline const LLColor4& LLColor4::set(const F64* vec)
{
- mV[VRED] = static_cast<F32>(vec[VRED]);
+ mV[VRED] = static_cast<F32>(vec[VRED]);
mV[VGREEN] = static_cast<F32>(vec[VGREEN]);
- mV[VBLUE] = static_cast<F32>(vec[VBLUE]);
+ mV[VBLUE] = static_cast<F32>(vec[VBLUE]);
mV[VALPHA] = static_cast<F32>(vec[VALPHA]);
return (*this);
}
// deprecated
-inline const LLColor4& LLColor4::setVec(F32 x, F32 y, F32 z)
+inline const LLColor4& LLColor4::setVec(F32 x, F32 y, F32 z)
{
- mV[VRED] = x;
+ mV[VRED] = x;
mV[VGREEN] = y;
- mV[VBLUE] = z;
+ mV[VBLUE] = z;
-// no change to alpha!
-// mV[VALPHA] = 1.f;
+ // no change to alpha!
+ // mV[VALPHA] = 1.f;
return (*this);
}
// deprecated
-inline const LLColor4& LLColor4::setVec(F32 x, F32 y, F32 z, F32 a)
+inline const LLColor4& LLColor4::setVec(F32 x, F32 y, F32 z, F32 a)
{
- mV[VRED] = x;
+ mV[VRED] = x;
mV[VGREEN] = y;
- mV[VBLUE] = z;
+ mV[VBLUE] = z;
mV[VALPHA] = a;
return (*this);
}
// deprecated
-inline const LLColor4& LLColor4::setVec(const LLColor4 &vec)
+inline const LLColor4& LLColor4::setVec(const LLColor4& vec)
{
- mV[VRED] = vec.mV[VRED];
+ mV[VRED] = vec.mV[VRED];
mV[VGREEN] = vec.mV[VGREEN];
- mV[VBLUE] = vec.mV[VBLUE];
+ mV[VBLUE] = vec.mV[VBLUE];
mV[VALPHA] = vec.mV[VALPHA];
return (*this);
}
-
// deprecated
-inline const LLColor4& LLColor4::setVec(const F32 *vec)
+inline const LLColor4& LLColor4::setVec(const F32* vec)
{
- mV[VRED] = vec[VRED];
+ mV[VRED] = vec[VRED];
mV[VGREEN] = vec[VGREEN];
- mV[VBLUE] = vec[VBLUE];
+ mV[VBLUE] = vec[VBLUE];
mV[VALPHA] = vec[VALPHA];
return (*this);
}
-inline const LLColor4& LLColor4::setAlpha(F32 a)
+inline const LLColor4& LLColor4::setAlpha(F32 a)
{
mV[VALPHA] = a;
return (*this);
@@ -405,155 +400,116 @@ inline const LLColor4& LLColor4::setAlpha(F32 a)
// LLColor4 Magnitude and Normalization Functions
-inline F32 LLColor4::length(void) const
+inline F32 LLColor4::length() const
{
- return (F32) sqrt(mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE]);
+ return sqrt(mV[VRED] * mV[VRED] + mV[VGREEN] * mV[VGREEN] + mV[VBLUE] * mV[VBLUE]);
}
-inline F32 LLColor4::lengthSquared(void) const
+inline F32 LLColor4::lengthSquared() const
{
- return mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE];
+ return mV[VRED] * mV[VRED] + mV[VGREEN] * mV[VGREEN] + mV[VBLUE] * mV[VBLUE];
}
-inline F32 LLColor4::normalize(void)
+inline F32 LLColor4::normalize()
{
- F32 mag = (F32) sqrt(mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE]);
+ F32 mag = sqrt(mV[VRED] * mV[VRED] + mV[VGREEN] * mV[VGREEN] + mV[VBLUE] * mV[VBLUE]);
F32 oomag;
if (mag)
{
- oomag = 1.f/mag;
+ oomag = 1.f / mag;
mV[VRED] *= oomag;
mV[VGREEN] *= oomag;
mV[VBLUE] *= oomag;
}
- return (mag);
+ return mag;
}
// deprecated
-inline F32 LLColor4::magVec(void) const
+inline F32 LLColor4::magVec() const
{
- return (F32) sqrt(mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE]);
+ return sqrt(mV[VRED] * mV[VRED] + mV[VGREEN] * mV[VGREEN] + mV[VBLUE] * mV[VBLUE]);
}
// deprecated
-inline F32 LLColor4::magVecSquared(void) const
+inline F32 LLColor4::magVecSquared() const
{
- return mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE];
+ return mV[VRED] * mV[VRED] + mV[VGREEN] * mV[VGREEN] + mV[VBLUE] * mV[VBLUE];
}
// deprecated
-inline F32 LLColor4::normVec(void)
+inline F32 LLColor4::normVec()
{
- F32 mag = (F32) sqrt(mV[VRED]*mV[VRED] + mV[VGREEN]*mV[VGREEN] + mV[VBLUE]*mV[VBLUE]);
+ F32 mag = sqrt(mV[VRED] * mV[VRED] + mV[VGREEN] * mV[VGREEN] + mV[VBLUE] * mV[VBLUE]);
F32 oomag;
if (mag)
{
- oomag = 1.f/mag;
+ oomag = 1.f / mag;
mV[VRED] *= oomag;
mV[VGREEN] *= oomag;
mV[VBLUE] *= oomag;
}
- return (mag);
+ return mag;
}
// LLColor4 Operators
-
-inline LLColor4 operator+(const LLColor4 &a, const LLColor4 &b)
+inline LLColor4 operator+(const LLColor4& a, const LLColor4& b)
{
- return LLColor4(
- a.mV[VRED] + b.mV[VRED],
- a.mV[VGREEN] + b.mV[VGREEN],
- a.mV[VBLUE] + b.mV[VBLUE],
- a.mV[VALPHA] + b.mV[VALPHA]);
+ return LLColor4(a.mV[VRED] + b.mV[VRED], a.mV[VGREEN] + b.mV[VGREEN], a.mV[VBLUE] + b.mV[VBLUE], a.mV[VALPHA] + b.mV[VALPHA]);
}
-inline LLColor4 operator-(const LLColor4 &a, const LLColor4 &b)
+inline LLColor4 operator-(const LLColor4& a, const LLColor4& b)
{
- return LLColor4(
- a.mV[VRED] - b.mV[VRED],
- a.mV[VGREEN] - b.mV[VGREEN],
- a.mV[VBLUE] - b.mV[VBLUE],
- a.mV[VALPHA] - b.mV[VALPHA]);
+ return LLColor4(a.mV[VRED] - b.mV[VRED], a.mV[VGREEN] - b.mV[VGREEN], a.mV[VBLUE] - b.mV[VBLUE], a.mV[VALPHA] - b.mV[VALPHA]);
}
-inline LLColor4 operator*(const LLColor4 &a, const LLColor4 &b)
+inline LLColor4 operator*(const LLColor4& a, const LLColor4& b)
{
- return LLColor4(
- a.mV[VRED] * b.mV[VRED],
- a.mV[VGREEN] * b.mV[VGREEN],
- a.mV[VBLUE] * b.mV[VBLUE],
- a.mV[VALPHA] * b.mV[VALPHA]);
+ return LLColor4(a.mV[VRED] * b.mV[VRED], a.mV[VGREEN] * b.mV[VGREEN], a.mV[VBLUE] * b.mV[VBLUE], a.mV[VALPHA] * b.mV[VALPHA]);
}
-inline LLColor4 operator*(const LLColor4 &a, F32 k)
+inline LLColor4 operator*(const LLColor4& a, F32 k)
{
// only affects rgb (not a!)
- return LLColor4(
- a.mV[VRED] * k,
- a.mV[VGREEN] * k,
- a.mV[VBLUE] * k,
- a.mV[VALPHA]);
+ return LLColor4(a.mV[VRED] * k, a.mV[VGREEN] * k, a.mV[VBLUE] * k, a.mV[VALPHA]);
}
-inline LLColor4 operator/(const LLColor4 &a, F32 k)
+inline LLColor4 operator/(const LLColor4& a, F32 k)
{
- return LLColor4(
- a.mV[VRED] / k,
- a.mV[VGREEN] / k,
- a.mV[VBLUE] / k,
- a.mV[VALPHA]);
+ return LLColor4(a.mV[VRED] / k, a.mV[VGREEN] / k, a.mV[VBLUE] / k, a.mV[VALPHA]);
}
-inline LLColor4 operator*(F32 k, const LLColor4 &a)
+inline LLColor4 operator*(F32 k, const LLColor4& a)
{
// only affects rgb (not a!)
- return LLColor4(
- a.mV[VRED] * k,
- a.mV[VGREEN] * k,
- a.mV[VBLUE] * k,
- a.mV[VALPHA]);
+ return LLColor4(a.mV[VRED] * k, a.mV[VGREEN] * k, a.mV[VBLUE] * k, a.mV[VALPHA]);
}
-inline LLColor4 operator%(F32 k, const LLColor4 &a)
+inline LLColor4 operator%(F32 k, const LLColor4& a)
{
// only affects alpha (not rgb!)
- return LLColor4(
- a.mV[VRED],
- a.mV[VGREEN],
- a.mV[VBLUE],
- a.mV[VALPHA] * k);
+ return LLColor4(a.mV[VRED], a.mV[VGREEN], a.mV[VBLUE], a.mV[VALPHA] * k);
}
-inline LLColor4 operator%(const LLColor4 &a, F32 k)
+inline LLColor4 operator%(const LLColor4& a, F32 k)
{
// only affects alpha (not rgb!)
- return LLColor4(
- a.mV[VRED],
- a.mV[VGREEN],
- a.mV[VBLUE],
- a.mV[VALPHA] * k);
+ return LLColor4(a.mV[VRED], a.mV[VGREEN], a.mV[VBLUE], a.mV[VALPHA] * k);
}
-inline bool operator==(const LLColor4 &a, const LLColor4 &b)
+inline bool operator==(const LLColor4& a, const LLColor4& b)
{
- return ( (a.mV[VRED] == b.mV[VRED])
- &&(a.mV[VGREEN] == b.mV[VGREEN])
- &&(a.mV[VBLUE] == b.mV[VBLUE])
- &&(a.mV[VALPHA] == b.mV[VALPHA]));
+ return ((a.mV[VRED] == b.mV[VRED]) && (a.mV[VGREEN] == b.mV[VGREEN]) && (a.mV[VBLUE] == b.mV[VBLUE]) && (a.mV[VALPHA] == b.mV[VALPHA]));
}
-inline bool operator!=(const LLColor4 &a, const LLColor4 &b)
+inline bool operator!=(const LLColor4& a, const LLColor4& b)
{
- return ( (a.mV[VRED] != b.mV[VRED])
- ||(a.mV[VGREEN] != b.mV[VGREEN])
- ||(a.mV[VBLUE] != b.mV[VBLUE])
- ||(a.mV[VALPHA] != b.mV[VALPHA]));
+ return ((a.mV[VRED] != b.mV[VRED]) || (a.mV[VGREEN] != b.mV[VGREEN]) || (a.mV[VBLUE] != b.mV[VBLUE]) || (a.mV[VALPHA] != b.mV[VALPHA]));
}
-inline const LLColor4& operator+=(LLColor4 &a, const LLColor4 &b)
+inline const LLColor4& operator+=(LLColor4& a, const LLColor4& b)
{
a.mV[VRED] += b.mV[VRED];
a.mV[VGREEN] += b.mV[VGREEN];
@@ -562,7 +518,7 @@ inline const LLColor4& operator+=(LLColor4 &a, const LLColor4 &b)
return a;
}
-inline const LLColor4& operator-=(LLColor4 &a, const LLColor4 &b)
+inline const LLColor4& operator-=(LLColor4& a, const LLColor4& b)
{
a.mV[VRED] -= b.mV[VRED];
a.mV[VGREEN] -= b.mV[VGREEN];
@@ -571,7 +527,7 @@ inline const LLColor4& operator-=(LLColor4 &a, const LLColor4 &b)
return a;
}
-inline const LLColor4& operator*=(LLColor4 &a, F32 k)
+inline const LLColor4& operator*=(LLColor4& a, F32 k)
{
// only affects rgb (not a!)
a.mV[VRED] *= k;
@@ -580,121 +536,120 @@ inline const LLColor4& operator*=(LLColor4 &a, F32 k)
return a;
}
-inline const LLColor4& operator *=(LLColor4 &a, const LLColor4 &b)
+inline const LLColor4& operator*=(LLColor4& a, const LLColor4& b)
{
a.mV[VRED] *= b.mV[VRED];
a.mV[VGREEN] *= b.mV[VGREEN];
a.mV[VBLUE] *= b.mV[VBLUE];
-// a.mV[VALPHA] *= b.mV[VALPHA];
+ // a.mV[VALPHA] *= b.mV[VALPHA];
return a;
}
-inline const LLColor4& operator%=(LLColor4 &a, F32 k)
+inline const LLColor4& operator%=(LLColor4& a, F32 k)
{
// only affects alpha (not rgb!)
a.mV[VALPHA] *= k;
return a;
}
-
// Non-member functions
-inline F32 distVec(const LLColor4 &a, const LLColor4 &b)
+inline F32 distVec(const LLColor4& a, const LLColor4& b)
{
LLColor4 vec = a - b;
- return (vec.length());
+ return vec.length();
}
-inline F32 distVec_squared(const LLColor4 &a, const LLColor4 &b)
+inline F32 distVec_squared(const LLColor4& a, const LLColor4& b)
{
LLColor4 vec = a - b;
- return (vec.lengthSquared());
+ return vec.lengthSquared();
}
-inline LLColor4 lerp(const LLColor4 &a, const LLColor4 &b, F32 u)
+inline LLColor4 lerp(const LLColor4& a, const LLColor4& b, F32 u)
{
- return LLColor4(
- a.mV[VRED] + (b.mV[VRED] - a.mV[VRED]) * u,
- a.mV[VGREEN] + (b.mV[VGREEN] - a.mV[VGREEN]) * u,
- a.mV[VBLUE] + (b.mV[VBLUE] - a.mV[VBLUE]) * u,
- a.mV[VALPHA] + (b.mV[VALPHA] - a.mV[VALPHA]) * u);
+ return LLColor4(a.mV[VRED] + (b.mV[VRED] - a.mV[VRED]) * u,
+ a.mV[VGREEN] + (b.mV[VGREEN] - a.mV[VGREEN]) * u,
+ a.mV[VBLUE] + (b.mV[VBLUE] - a.mV[VBLUE]) * u,
+ a.mV[VALPHA] + (b.mV[VALPHA] - a.mV[VALPHA]) * u);
}
inline bool LLColor4::operator<(const LLColor4& rhs) const
{
- if (mV[0] != rhs.mV[0])
+ if (mV[VRED] != rhs.mV[VRED])
{
- return mV[0] < rhs.mV[0];
+ return mV[VRED] < rhs.mV[VRED];
}
- if (mV[1] != rhs.mV[1])
+ if (mV[VGREEN] != rhs.mV[VGREEN])
{
- return mV[1] < rhs.mV[1];
+ return mV[VGREEN] < rhs.mV[VGREEN];
}
- if (mV[2] != rhs.mV[2])
+ if (mV[VBLUE] != rhs.mV[VBLUE])
{
- return mV[2] < rhs.mV[2];
+ return mV[VBLUE] < rhs.mV[VBLUE];
}
- return mV[3] < rhs.mV[3];
+ return mV[VALPHA] < rhs.mV[VALPHA];
}
void LLColor4::clamp()
{
// Clamp the color...
- if (mV[0] < 0.f)
+ if (mV[VRED] < 0.f)
{
- mV[0] = 0.f;
+ mV[VRED] = 0.f;
}
- else if (mV[0] > 1.f)
+ else if (mV[VRED] > 1.f)
{
- mV[0] = 1.f;
+ mV[VRED] = 1.f;
}
- if (mV[1] < 0.f)
+ if (mV[VGREEN] < 0.f)
{
- mV[1] = 0.f;
+ mV[VGREEN] = 0.f;
}
- else if (mV[1] > 1.f)
+ else if (mV[VGREEN] > 1.f)
{
- mV[1] = 1.f;
+ mV[VGREEN] = 1.f;
}
- if (mV[2] < 0.f)
+ if (mV[VBLUE] < 0.f)
{
- mV[2] = 0.f;
+ mV[VBLUE] = 0.f;
}
- else if (mV[2] > 1.f)
+ else if (mV[VBLUE] > 1.f)
{
- mV[2] = 1.f;
+ mV[VBLUE] = 1.f;
}
- if (mV[3] < 0.f)
+ if (mV[VALPHA] < 0.f)
{
- mV[3] = 0.f;
+ mV[VALPHA] = 0.f;
}
- else if (mV[3] > 1.f)
+ else if (mV[VALPHA] > 1.f)
{
- mV[3] = 1.f;
+ mV[VALPHA] = 1.f;
}
}
// Return the given linear space color value in gamma corrected (sRGB) space
-inline const LLColor4 srgbColor4(const LLColor4 &a) {
+inline const LLColor4 srgbColor4(const LLColor4& a)
+{
LLColor4 srgbColor;
- srgbColor.mV[0] = linearTosRGB(a.mV[0]);
- srgbColor.mV[1] = linearTosRGB(a.mV[1]);
- srgbColor.mV[2] = linearTosRGB(a.mV[2]);
- srgbColor.mV[3] = a.mV[3];
+ srgbColor.mV[VRED] = linearTosRGB(a.mV[VRED]);
+ srgbColor.mV[VGREEN] = linearTosRGB(a.mV[VGREEN]);
+ srgbColor.mV[VBLUE] = linearTosRGB(a.mV[VBLUE]);
+ srgbColor.mV[VALPHA] = a.mV[VALPHA];
return srgbColor;
}
// Return the given gamma corrected (sRGB) color in linear space
-inline const LLColor4 linearColor4(const LLColor4 &a)
+inline const LLColor4 linearColor4(const LLColor4& a)
{
LLColor4 linearColor;
- linearColor.mV[0] = sRGBtoLinear(a.mV[0]);
- linearColor.mV[1] = sRGBtoLinear(a.mV[1]);
- linearColor.mV[2] = sRGBtoLinear(a.mV[2]);
- linearColor.mV[3] = a.mV[3];
+ linearColor.mV[VRED] = sRGBtoLinear(a.mV[VRED]);
+ linearColor.mV[VGREEN] = sRGBtoLinear(a.mV[VGREEN]);
+ linearColor.mV[VBLUE] = sRGBtoLinear(a.mV[VBLUE]);
+ linearColor.mV[VALPHA] = a.mV[VALPHA];
return linearColor;
}
@@ -720,4 +675,3 @@ void LLColor4::write(std::vector<T>& v) const
}
#endif
-
diff --git a/indra/llmath/v4coloru.cpp b/indra/llmath/v4coloru.cpp
index acf349245a..c495ffdb4c 100644
--- a/indra/llmath/v4coloru.cpp
+++ b/indra/llmath/v4coloru.cpp
@@ -26,10 +26,7 @@
#include "linden_common.h"
-//#include "v3coloru.h"
#include "v4coloru.h"
-#include "v4color.h"
-//#include "vmath.h"
#include "llmath.h"
// LLColor4U
@@ -39,49 +36,7 @@ LLColor4U LLColor4U::red (255, 0, 0, 255);
LLColor4U LLColor4U::green( 0, 255, 0, 255);
LLColor4U LLColor4U::blue ( 0, 0, 255, 255);
-// conversion
-/* inlined to fix gcc compile link error
-LLColor4U::operator LLColor4()
-{
- return(LLColor4((F32)mV[VRED]/255.f,(F32)mV[VGREEN]/255.f,(F32)mV[VBLUE]/255.f,(F32)mV[VALPHA]/255.f));
-}
-*/
-
-// Constructors
-
-
-/*
-LLColor4U::LLColor4U(const LLColor3 &vec)
-{
- mV[VRED] = vec.mV[VRED];
- mV[VGREEN] = vec.mV[VGREEN];
- mV[VBLUE] = vec.mV[VBLUE];
- mV[VALPHA] = 255;
-}
-*/
-
-
-// Clear and Assignment Functions
-
-
-
-// LLColor4U Operators
-
-/*
-LLColor4U LLColor4U::operator=(const LLColor3 &a)
-{
- mV[VRED] = a.mV[VRED];
- mV[VGREEN] = a.mV[VGREEN];
- mV[VBLUE] = a.mV[VBLUE];
-
-// converting from an rgb sets a=1 (opaque)
- mV[VALPHA] = 255;
- return (*this);
-}
-*/
-
-
-std::ostream& operator<<(std::ostream& s, const LLColor4U &a)
+std::ostream& operator<<(std::ostream& s, const LLColor4U& a)
{
s << "{ " << (S32)a.mV[VRED] << ", " << (S32)a.mV[VGREEN] << ", " << (S32)a.mV[VBLUE] << ", " << (S32)a.mV[VALPHA] << " }";
return s;
@@ -90,31 +45,31 @@ std::ostream& operator<<(std::ostream& s, const LLColor4U &a)
// static
bool LLColor4U::parseColor4U(const std::string& buf, LLColor4U* value)
{
- if( buf.empty() || value == nullptr)
+ if (buf.empty() || value == nullptr)
{
return false;
}
- U32 v[4];
- S32 count = sscanf( buf.c_str(), "%u, %u, %u, %u", v + 0, v + 1, v + 2, v + 3 );
- if (1 == count )
+ U32 v[4]{};
+ S32 count = sscanf(buf.c_str(), "%u, %u, %u, %u", v + 0, v + 1, v + 2, v + 3);
+ if (1 == count)
{
// try this format
- count = sscanf( buf.c_str(), "%u %u %u %u", v + 0, v + 1, v + 2, v + 3 );
+ count = sscanf(buf.c_str(), "%u %u %u %u", v + 0, v + 1, v + 2, v + 3);
}
- if( 4 != count )
+ if (4 != count)
{
return false;
}
- for( S32 i = 0; i < 4; i++ )
+ for (S32 i = 0; i < 4; i++)
{
- if( v[i] > U8_MAX )
+ if (v[i] > U8_MAX)
{
return false;
}
}
- value->set( U8(v[0]), U8(v[1]), U8(v[2]), U8(v[3]) );
+ value->set(U8(v[VRED]), U8(v[VGREEN]), U8(v[VBLUE]), U8(v[VALPHA]));
return true;
}
diff --git a/indra/llmath/v4coloru.h b/indra/llmath/v4coloru.h
index 29128a08a7..bfa998bc58 100644
--- a/indra/llmath/v4coloru.h
+++ b/indra/llmath/v4coloru.h
@@ -28,104 +28,93 @@
#define LL_V4COLORU_H
#include "llerror.h"
-//#include "vmath.h"
#include "llmath.h"
-//#include "v4color.h"
#include "v3color.h"
#include "v4color.h"
-//class LLColor3U;
class LLColor4;
// LLColor4U = | red green blue alpha |
-static const U32 LENGTHOFCOLOR4U = 4;
-
+static constexpr U32 LENGTHOFCOLOR4U = 4;
class LLColor4U
{
public:
-
U8 mV[LENGTHOFCOLOR4U];
- LLColor4U(); // Initializes LLColor4U to (0, 0, 0, 1)
- LLColor4U(U8 r, U8 g, U8 b); // Initializes LLColor4U to (r, g, b, 1)
- LLColor4U(U8 r, U8 g, U8 b, U8 a); // Initializes LLColor4U to (r. g, b, a)
- LLColor4U(const U8 *vec); // Initializes LLColor4U to (vec[0]. vec[1], vec[2], 1)
- explicit LLColor4U(const LLSD& sd)
- {
- setValue(sd);
- }
+ LLColor4U(); // Initializes LLColor4U to (0, 0, 0, 1)
+ LLColor4U(U8 r, U8 g, U8 b); // Initializes LLColor4U to (r, g, b, 1)
+ LLColor4U(U8 r, U8 g, U8 b, U8 a); // Initializes LLColor4U to (r. g, b, a)
+ LLColor4U(const U8* vec); // Initializes LLColor4U to (vec[0]. vec[1], vec[2], 1)
+ explicit LLColor4U(const LLSD& sd) { setValue(sd); }
void setValue(const LLSD& sd)
{
- mV[0] = sd[0].asInteger();
- mV[1] = sd[1].asInteger();
- mV[2] = sd[2].asInteger();
- mV[3] = sd[3].asInteger();
+ mV[VRED] = sd[VRED].asInteger();
+ mV[VGREEN] = sd[VGREEN].asInteger();
+ mV[VBLUE] = sd[VBLUE].asInteger();
+ mV[VALPHA] = sd[VALPHA].asInteger();
}
LLSD getValue() const
{
LLSD ret;
- ret[0] = mV[0];
- ret[1] = mV[1];
- ret[2] = mV[2];
- ret[3] = mV[3];
+ ret[VRED] = mV[VRED];
+ ret[VGREEN] = mV[VGREEN];
+ ret[VBLUE] = mV[VBLUE];
+ ret[VALPHA] = mV[VALPHA];
return ret;
}
- const LLColor4U& setToBlack(); // zero LLColor4U to (0, 0, 0, 1)
- const LLColor4U& setToWhite(); // zero LLColor4U to (0, 0, 0, 1)
+ const LLColor4U& setToBlack(); // zero LLColor4U to (0, 0, 0, 1)
+ const LLColor4U& setToWhite(); // zero LLColor4U to (0, 0, 0, 1)
- const LLColor4U& set(U8 r, U8 g, U8 b, U8 a);// Sets LLColor4U to (r, g, b, a)
- const LLColor4U& set(U8 r, U8 g, U8 b); // Sets LLColor4U to (r, g, b) (no change in a)
- const LLColor4U& set(const LLColor4U &vec); // Sets LLColor4U to vec
- const LLColor4U& set(const U8 *vec); // Sets LLColor4U to vec
+ const LLColor4U& set(U8 r, U8 g, U8 b, U8 a); // Sets LLColor4U to (r, g, b, a)
+ const LLColor4U& set(U8 r, U8 g, U8 b); // Sets LLColor4U to (r, g, b) (no change in a)
+ const LLColor4U& set(const LLColor4U& vec); // Sets LLColor4U to vec
+ const LLColor4U& set(const U8* vec); // Sets LLColor4U to vec
- const LLColor4U& setVec(U8 r, U8 g, U8 b, U8 a); // deprecated -- use set()
- const LLColor4U& setVec(U8 r, U8 g, U8 b); // deprecated -- use set()
- const LLColor4U& setVec(const LLColor4U &vec); // deprecated -- use set()
- const LLColor4U& setVec(const U8 *vec); // deprecated -- use set()
+ const LLColor4U& setVec(U8 r, U8 g, U8 b, U8 a); // deprecated -- use set()
+ const LLColor4U& setVec(U8 r, U8 g, U8 b); // deprecated -- use set()
+ const LLColor4U& setVec(const LLColor4U& vec); // deprecated -- use set()
+ const LLColor4U& setVec(const U8* vec); // deprecated -- use set()
- const LLColor4U& setAlpha(U8 a);
+ const LLColor4U& setAlpha(U8 a);
- F32 magVec() const; // deprecated -- use length()
- F32 magVecSquared() const; // deprecated -- use lengthSquared()
+ F32 magVec() const; // deprecated -- use length()
+ F32 magVecSquared() const; // deprecated -- use lengthSquared()
- F32 length() const; // Returns magnitude squared of LLColor4U
- F32 lengthSquared() const; // Returns magnitude squared of LLColor4U
+ F32 length() const; // Returns magnitude squared of LLColor4U
+ F32 lengthSquared() const; // Returns magnitude squared of LLColor4U
- friend std::ostream& operator<<(std::ostream& s, const LLColor4U &a); // Print a
- friend LLColor4U operator+(const LLColor4U &a, const LLColor4U &b); // Return vector a + b
- friend LLColor4U operator-(const LLColor4U &a, const LLColor4U &b); // Return vector a minus b
- friend LLColor4U operator*(const LLColor4U &a, const LLColor4U &b); // Return a * b
- friend bool operator==(const LLColor4U &a, const LLColor4U &b); // Return a == b
- friend bool operator!=(const LLColor4U &a, const LLColor4U &b); // Return a != b
+ friend std::ostream& operator<<(std::ostream& s, const LLColor4U& a); // Print a
+ friend LLColor4U operator+(const LLColor4U& a, const LLColor4U& b); // Return vector a + b
+ friend LLColor4U operator-(const LLColor4U& a, const LLColor4U& b); // Return vector a minus b
+ friend LLColor4U operator*(const LLColor4U& a, const LLColor4U& b); // Return a * b
+ friend bool operator==(const LLColor4U& a, const LLColor4U& b); // Return a == b
+ friend bool operator!=(const LLColor4U& a, const LLColor4U& b); // Return a != b
- friend const LLColor4U& operator+=(LLColor4U &a, const LLColor4U &b); // Return vector a + b
- friend const LLColor4U& operator-=(LLColor4U &a, const LLColor4U &b); // Return vector a minus b
- friend const LLColor4U& operator*=(LLColor4U &a, U8 k); // Return rgb times scaler k (no alpha change)
- friend const LLColor4U& operator%=(LLColor4U &a, U8 k); // Return alpha times scaler k (no rgb change)
+ friend const LLColor4U& operator+=(LLColor4U& a, const LLColor4U& b); // Return vector a + b
+ friend const LLColor4U& operator-=(LLColor4U& a, const LLColor4U& b); // Return vector a minus b
+ friend const LLColor4U& operator*=(LLColor4U& a, U8 k); // Return rgb times scaler k (no alpha change)
+ friend const LLColor4U& operator%=(LLColor4U& a, U8 k); // Return alpha times scaler k (no rgb change)
- LLColor4U addClampMax(const LLColor4U &color); // Add and clamp the max
+ LLColor4U addClampMax(const LLColor4U& color); // Add and clamp the max
- LLColor4U multAll(const F32 k); // Multiply ALL channels by scalar k
+ LLColor4U multAll(const F32 k); // Multiply ALL channels by scalar k
- inline void setVecScaleClamp(const LLColor3 &color);
- inline void setVecScaleClamp(const LLColor4 &color);
+ inline void setVecScaleClamp(const LLColor3& color);
+ inline void setVecScaleClamp(const LLColor4& color);
static bool parseColor4U(const std::string& buf, LLColor4U* value);
// conversion
- operator LLColor4() const
- {
- return LLColor4(*this);
- }
+ operator LLColor4() const { return LLColor4(*this); }
- U32 asRGBA() const;
- void fromRGBA( U32 aVal );
+ U32 asRGBA() const;
+ void fromRGBA(U32 aVal);
static LLColor4U white;
static LLColor4U black;
@@ -134,104 +123,95 @@ public:
static LLColor4U blue;
};
-
// Non-member functions
-F32 distVec(const LLColor4U &a, const LLColor4U &b); // Returns distance between a and b
-F32 distVec_squared(const LLColor4U &a, const LLColor4U &b); // Returns distance squared between a and b
-
+F32 distVec(const LLColor4U& a, const LLColor4U& b); // Returns distance between a and b
+F32 distVec_squared(const LLColor4U& a, const LLColor4U& b); // Returns distance squared between a and b
inline LLColor4U::LLColor4U()
{
- mV[VRED] = 0;
+ mV[VRED] = 0;
mV[VGREEN] = 0;
- mV[VBLUE] = 0;
+ mV[VBLUE] = 0;
mV[VALPHA] = 255;
}
inline LLColor4U::LLColor4U(U8 r, U8 g, U8 b)
{
- mV[VRED] = r;
+ mV[VRED] = r;
mV[VGREEN] = g;
- mV[VBLUE] = b;
+ mV[VBLUE] = b;
mV[VALPHA] = 255;
}
inline LLColor4U::LLColor4U(U8 r, U8 g, U8 b, U8 a)
{
- mV[VRED] = r;
+ mV[VRED] = r;
mV[VGREEN] = g;
- mV[VBLUE] = b;
+ mV[VBLUE] = b;
mV[VALPHA] = a;
}
-inline LLColor4U::LLColor4U(const U8 *vec)
+inline LLColor4U::LLColor4U(const U8* vec)
{
- mV[VRED] = vec[VRED];
+ mV[VRED] = vec[VRED];
mV[VGREEN] = vec[VGREEN];
- mV[VBLUE] = vec[VBLUE];
+ mV[VBLUE] = vec[VBLUE];
mV[VALPHA] = vec[VALPHA];
}
-/*
-inline LLColor4U::operator LLColor4()
-{
- return(LLColor4((F32)mV[VRED]/255.f,(F32)mV[VGREEN]/255.f,(F32)mV[VBLUE]/255.f,(F32)mV[VALPHA]/255.f));
-}
-*/
-
inline const LLColor4U& LLColor4U::setToBlack(void)
{
- mV[VRED] = 0;
+ mV[VRED] = 0;
mV[VGREEN] = 0;
- mV[VBLUE] = 0;
+ mV[VBLUE] = 0;
mV[VALPHA] = 255;
return (*this);
}
inline const LLColor4U& LLColor4U::setToWhite(void)
{
- mV[VRED] = 255;
+ mV[VRED] = 255;
mV[VGREEN] = 255;
- mV[VBLUE] = 255;
+ mV[VBLUE] = 255;
mV[VALPHA] = 255;
return (*this);
}
inline const LLColor4U& LLColor4U::set(const U8 x, const U8 y, const U8 z)
{
- mV[VRED] = x;
+ mV[VRED] = x;
mV[VGREEN] = y;
- mV[VBLUE] = z;
+ mV[VBLUE] = z;
-// no change to alpha!
-// mV[VALPHA] = 255;
+ // no change to alpha!
+ // mV[VALPHA] = 255;
return (*this);
}
inline const LLColor4U& LLColor4U::set(const U8 r, const U8 g, const U8 b, U8 a)
{
- mV[0] = r;
- mV[1] = g;
- mV[2] = b;
- mV[3] = a;
+ mV[VRED] = r;
+ mV[VGREEN] = g;
+ mV[VBLUE] = b;
+ mV[VALPHA] = a;
return (*this);
}
-inline const LLColor4U& LLColor4U::set(const LLColor4U &vec)
+inline const LLColor4U& LLColor4U::set(const LLColor4U& vec)
{
- mV[VRED] = vec.mV[VRED];
+ mV[VRED] = vec.mV[VRED];
mV[VGREEN] = vec.mV[VGREEN];
- mV[VBLUE] = vec.mV[VBLUE];
+ mV[VBLUE] = vec.mV[VBLUE];
mV[VALPHA] = vec.mV[VALPHA];
return (*this);
}
-inline const LLColor4U& LLColor4U::set(const U8 *vec)
+inline const LLColor4U& LLColor4U::set(const U8* vec)
{
- mV[VRED] = vec[VRED];
+ mV[VRED] = vec[VRED];
mV[VGREEN] = vec[VGREEN];
- mV[VBLUE] = vec[VBLUE];
+ mV[VBLUE] = vec[VBLUE];
mV[VALPHA] = vec[VALPHA];
return (*this);
}
@@ -239,12 +219,12 @@ inline const LLColor4U& LLColor4U::set(const U8 *vec)
// deprecated
inline const LLColor4U& LLColor4U::setVec(const U8 x, const U8 y, const U8 z)
{
- mV[VRED] = x;
+ mV[VRED] = x;
mV[VGREEN] = y;
- mV[VBLUE] = z;
+ mV[VBLUE] = z;
-// no change to alpha!
-// mV[VALPHA] = 255;
+ // no change to alpha!
+ // mV[VALPHA] = 255;
return (*this);
}
@@ -252,29 +232,29 @@ inline const LLColor4U& LLColor4U::setVec(const U8 x, const U8 y, const U8 z)
// deprecated
inline const LLColor4U& LLColor4U::setVec(const U8 r, const U8 g, const U8 b, U8 a)
{
- mV[0] = r;
- mV[1] = g;
- mV[2] = b;
- mV[3] = a;
+ mV[VRED] = r;
+ mV[VGREEN] = g;
+ mV[VBLUE] = b;
+ mV[VALPHA] = a;
return (*this);
}
// deprecated
-inline const LLColor4U& LLColor4U::setVec(const LLColor4U &vec)
+inline const LLColor4U& LLColor4U::setVec(const LLColor4U& vec)
{
- mV[VRED] = vec.mV[VRED];
+ mV[VRED] = vec.mV[VRED];
mV[VGREEN] = vec.mV[VGREEN];
- mV[VBLUE] = vec.mV[VBLUE];
+ mV[VBLUE] = vec.mV[VBLUE];
mV[VALPHA] = vec.mV[VALPHA];
return (*this);
}
// deprecated
-inline const LLColor4U& LLColor4U::setVec(const U8 *vec)
+inline const LLColor4U& LLColor4U::setVec(const U8* vec)
{
- mV[VRED] = vec[VRED];
+ mV[VRED] = vec[VRED];
mV[VGREEN] = vec[VGREEN];
- mV[VBLUE] = vec[VBLUE];
+ mV[VBLUE] = vec[VBLUE];
mV[VALPHA] = vec[VALPHA];
return (*this);
}
@@ -287,131 +267,68 @@ inline const LLColor4U& LLColor4U::setAlpha(U8 a)
// LLColor4U Magnitude and Normalization Functions
-inline F32 LLColor4U::length(void) const
+inline F32 LLColor4U::length() const
{
- return (F32) sqrt( ((F32)mV[VRED]) * mV[VRED] + ((F32)mV[VGREEN]) * mV[VGREEN] + ((F32)mV[VBLUE]) * mV[VBLUE] );
+ return sqrt(((F32)mV[VRED]) * mV[VRED] + ((F32)mV[VGREEN]) * mV[VGREEN] + ((F32)mV[VBLUE]) * mV[VBLUE]);
}
-inline F32 LLColor4U::lengthSquared(void) const
+inline F32 LLColor4U::lengthSquared() const
{
return ((F32)mV[VRED]) * mV[VRED] + ((F32)mV[VGREEN]) * mV[VGREEN] + ((F32)mV[VBLUE]) * mV[VBLUE];
}
// deprecated
-inline F32 LLColor4U::magVec(void) const
+inline F32 LLColor4U::magVec() const
{
- return (F32) sqrt( ((F32)mV[VRED]) * mV[VRED] + ((F32)mV[VGREEN]) * mV[VGREEN] + ((F32)mV[VBLUE]) * mV[VBLUE] );
+ return sqrt(((F32)mV[VRED]) * mV[VRED] + ((F32)mV[VGREEN]) * mV[VGREEN] + ((F32)mV[VBLUE]) * mV[VBLUE]);
}
// deprecated
-inline F32 LLColor4U::magVecSquared(void) const
+inline F32 LLColor4U::magVecSquared() const
{
return ((F32)mV[VRED]) * mV[VRED] + ((F32)mV[VGREEN]) * mV[VGREEN] + ((F32)mV[VBLUE]) * mV[VBLUE];
}
-inline LLColor4U operator+(const LLColor4U &a, const LLColor4U &b)
+inline LLColor4U operator+(const LLColor4U& a, const LLColor4U& b)
{
- return LLColor4U(
- a.mV[VRED] + b.mV[VRED],
- a.mV[VGREEN] + b.mV[VGREEN],
- a.mV[VBLUE] + b.mV[VBLUE],
- a.mV[VALPHA] + b.mV[VALPHA]);
+ return LLColor4U(a.mV[VRED] + b.mV[VRED], a.mV[VGREEN] + b.mV[VGREEN], a.mV[VBLUE] + b.mV[VBLUE], a.mV[VALPHA] + b.mV[VALPHA]);
}
-inline LLColor4U operator-(const LLColor4U &a, const LLColor4U &b)
+inline LLColor4U operator-(const LLColor4U& a, const LLColor4U& b)
{
- return LLColor4U(
- a.mV[VRED] - b.mV[VRED],
- a.mV[VGREEN] - b.mV[VGREEN],
- a.mV[VBLUE] - b.mV[VBLUE],
- a.mV[VALPHA] - b.mV[VALPHA]);
+ return LLColor4U(a.mV[VRED] - b.mV[VRED], a.mV[VGREEN] - b.mV[VGREEN], a.mV[VBLUE] - b.mV[VBLUE], a.mV[VALPHA] - b.mV[VALPHA]);
}
-inline LLColor4U operator*(const LLColor4U &a, const LLColor4U &b)
+inline LLColor4U operator*(const LLColor4U& a, const LLColor4U& b)
{
- return LLColor4U(
- a.mV[VRED] * b.mV[VRED],
- a.mV[VGREEN] * b.mV[VGREEN],
- a.mV[VBLUE] * b.mV[VBLUE],
- a.mV[VALPHA] * b.mV[VALPHA]);
+ return LLColor4U(a.mV[VRED] * b.mV[VRED], a.mV[VGREEN] * b.mV[VGREEN], a.mV[VBLUE] * b.mV[VBLUE], a.mV[VALPHA] * b.mV[VALPHA]);
}
-inline LLColor4U LLColor4U::addClampMax(const LLColor4U &color)
+inline LLColor4U LLColor4U::addClampMax(const LLColor4U& color)
{
return LLColor4U(llmin((S32)mV[VRED] + color.mV[VRED], 255),
- llmin((S32)mV[VGREEN] + color.mV[VGREEN], 255),
- llmin((S32)mV[VBLUE] + color.mV[VBLUE], 255),
- llmin((S32)mV[VALPHA] + color.mV[VALPHA], 255));
+ llmin((S32)mV[VGREEN] + color.mV[VGREEN], 255),
+ llmin((S32)mV[VBLUE] + color.mV[VBLUE], 255),
+ llmin((S32)mV[VALPHA] + color.mV[VALPHA], 255));
}
inline LLColor4U LLColor4U::multAll(const F32 k)
{
// Round to nearest
- return LLColor4U(
- (U8)ll_round(mV[VRED] * k),
- (U8)ll_round(mV[VGREEN] * k),
- (U8)ll_round(mV[VBLUE] * k),
- (U8)ll_round(mV[VALPHA] * k));
-}
-/*
-inline LLColor4U operator*(const LLColor4U &a, U8 k)
-{
- // only affects rgb (not a!)
- return LLColor4U(
- a.mV[VRED] * k,
- a.mV[VGREEN] * k,
- a.mV[VBLUE] * k,
- a.mV[VALPHA]);
+ return LLColor4U((U8)ll_round(mV[VRED] * k), (U8)ll_round(mV[VGREEN] * k), (U8)ll_round(mV[VBLUE] * k), (U8)ll_round(mV[VALPHA] * k));
}
-inline LLColor4U operator*(U8 k, const LLColor4U &a)
+inline bool operator==(const LLColor4U& a, const LLColor4U& b)
{
- // only affects rgb (not a!)
- return LLColor4U(
- a.mV[VRED] * k,
- a.mV[VGREEN] * k,
- a.mV[VBLUE] * k,
- a.mV[VALPHA]);
+ return ((a.mV[VRED] == b.mV[VRED]) && (a.mV[VGREEN] == b.mV[VGREEN]) && (a.mV[VBLUE] == b.mV[VBLUE]) && (a.mV[VALPHA] == b.mV[VALPHA]));
}
-inline LLColor4U operator%(U8 k, const LLColor4U &a)
+inline bool operator!=(const LLColor4U& a, const LLColor4U& b)
{
- // only affects alpha (not rgb!)
- return LLColor4U(
- a.mV[VRED],
- a.mV[VGREEN],
- a.mV[VBLUE],
- a.mV[VALPHA] * k );
+ return ((a.mV[VRED] != b.mV[VRED]) || (a.mV[VGREEN] != b.mV[VGREEN]) || (a.mV[VBLUE] != b.mV[VBLUE]) || (a.mV[VALPHA] != b.mV[VALPHA]));
}
-inline LLColor4U operator%(const LLColor4U &a, U8 k)
-{
- // only affects alpha (not rgb!)
- return LLColor4U(
- a.mV[VRED],
- a.mV[VGREEN],
- a.mV[VBLUE],
- a.mV[VALPHA] * k );
-}
-*/
-
-inline bool operator==(const LLColor4U &a, const LLColor4U &b)
-{
- return ( (a.mV[VRED] == b.mV[VRED])
- &&(a.mV[VGREEN] == b.mV[VGREEN])
- &&(a.mV[VBLUE] == b.mV[VBLUE])
- &&(a.mV[VALPHA] == b.mV[VALPHA]));
-}
-
-inline bool operator!=(const LLColor4U &a, const LLColor4U &b)
-{
- return ( (a.mV[VRED] != b.mV[VRED])
- ||(a.mV[VGREEN] != b.mV[VGREEN])
- ||(a.mV[VBLUE] != b.mV[VBLUE])
- ||(a.mV[VALPHA] != b.mV[VALPHA]));
-}
-
-inline const LLColor4U& operator+=(LLColor4U &a, const LLColor4U &b)
+inline const LLColor4U& operator+=(LLColor4U& a, const LLColor4U& b)
{
a.mV[VRED] += b.mV[VRED];
a.mV[VGREEN] += b.mV[VGREEN];
@@ -420,7 +337,7 @@ inline const LLColor4U& operator+=(LLColor4U &a, const LLColor4U &b)
return a;
}
-inline const LLColor4U& operator-=(LLColor4U &a, const LLColor4U &b)
+inline const LLColor4U& operator-=(LLColor4U& a, const LLColor4U& b)
{
a.mV[VRED] -= b.mV[VRED];
a.mV[VGREEN] -= b.mV[VGREEN];
@@ -429,7 +346,7 @@ inline const LLColor4U& operator-=(LLColor4U &a, const LLColor4U &b)
return a;
}
-inline const LLColor4U& operator*=(LLColor4U &a, U8 k)
+inline const LLColor4U& operator*=(LLColor4U& a, U8 k)
{
// only affects rgb (not a!)
a.mV[VRED] *= k;
@@ -438,20 +355,20 @@ inline const LLColor4U& operator*=(LLColor4U &a, U8 k)
return a;
}
-inline const LLColor4U& operator%=(LLColor4U &a, U8 k)
+inline const LLColor4U& operator%=(LLColor4U& a, U8 k)
{
// only affects alpha (not rgb!)
a.mV[VALPHA] *= k;
return a;
}
-inline F32 distVec(const LLColor4U &a, const LLColor4U &b)
+inline F32 distVec(const LLColor4U& a, const LLColor4U& b)
{
LLColor4U vec = a - b;
return (vec.length());
}
-inline F32 distVec_squared(const LLColor4U &a, const LLColor4U &b)
+inline F32 distVec_squared(const LLColor4U& a, const LLColor4U& b)
{
LLColor4U vec = a - b;
return (vec.lengthSquared());
@@ -460,13 +377,13 @@ inline F32 distVec_squared(const LLColor4U &a, const LLColor4U &b)
void LLColor4U::setVecScaleClamp(const LLColor4& color)
{
F32 color_scale_factor = 255.f;
- F32 max_color = llmax(color.mV[0], color.mV[1], color.mV[2]);
+ F32 max_color = llmax(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE]);
if (max_color > 1.f)
{
color_scale_factor /= max_color;
}
- const S32 MAX_COLOR = 255;
- S32 r = ll_round(color.mV[0] * color_scale_factor);
+ constexpr S32 MAX_COLOR = 255;
+ S32 r = ll_round(color.mV[VRED] * color_scale_factor);
if (r > MAX_COLOR)
{
r = MAX_COLOR;
@@ -475,9 +392,9 @@ void LLColor4U::setVecScaleClamp(const LLColor4& color)
{
r = 0;
}
- mV[0] = r;
+ mV[VRED] = r;
- S32 g = ll_round(color.mV[1] * color_scale_factor);
+ S32 g = ll_round(color.mV[VGREEN] * color_scale_factor);
if (g > MAX_COLOR)
{
g = MAX_COLOR;
@@ -486,9 +403,9 @@ void LLColor4U::setVecScaleClamp(const LLColor4& color)
{
g = 0;
}
- mV[1] = g;
+ mV[VGREEN] = g;
- S32 b = ll_round(color.mV[2] * color_scale_factor);
+ S32 b = ll_round(color.mV[VBLUE] * color_scale_factor);
if (b > MAX_COLOR)
{
b = MAX_COLOR;
@@ -497,10 +414,10 @@ void LLColor4U::setVecScaleClamp(const LLColor4& color)
{
b = 0;
}
- mV[2] = b;
+ mV[VBLUE] = b;
// Alpha shouldn't be scaled, just clamped...
- S32 a = ll_round(color.mV[3] * MAX_COLOR);
+ S32 a = ll_round(color.mV[VALPHA] * MAX_COLOR);
if (a > MAX_COLOR)
{
a = MAX_COLOR;
@@ -509,44 +426,42 @@ void LLColor4U::setVecScaleClamp(const LLColor4& color)
{
a = 0;
}
- mV[3] = a;
+ mV[VALPHA] = a;
}
void LLColor4U::setVecScaleClamp(const LLColor3& color)
{
F32 color_scale_factor = 255.f;
- F32 max_color = llmax(color.mV[0], color.mV[1], color.mV[2]);
+ F32 max_color = llmax(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE]);
if (max_color > 1.f)
{
color_scale_factor /= max_color;
}
const S32 MAX_COLOR = 255;
- S32 r = ll_round(color.mV[0] * color_scale_factor);
+ S32 r = ll_round(color.mV[VRED] * color_scale_factor);
if (r > MAX_COLOR)
{
r = MAX_COLOR;
}
- else
- if (r < 0)
+ else if (r < 0)
{
r = 0;
}
- mV[0] = r;
+ mV[VRED] = r;
- S32 g = ll_round(color.mV[1] * color_scale_factor);
+ S32 g = ll_round(color.mV[VGREEN] * color_scale_factor);
if (g > MAX_COLOR)
{
g = MAX_COLOR;
}
- else
- if (g < 0)
+ else if (g < 0)
{
g = 0;
}
- mV[1] = g;
+ mV[VGREEN] = g;
- S32 b = ll_round(color.mV[2] * color_scale_factor);
+ S32 b = ll_round(color.mV[VBLUE] * color_scale_factor);
if (b > MAX_COLOR)
{
b = MAX_COLOR;
@@ -555,31 +470,29 @@ void LLColor4U::setVecScaleClamp(const LLColor3& color)
{
b = 0;
}
- mV[2] = b;
+ mV[VBLUE] = b;
- mV[3] = 255;
+ mV[VALPHA] = 255;
}
inline U32 LLColor4U::asRGBA() const
{
// Little endian: values are swapped in memory. The original code access the array like a U32, so we need to swap here
- return (mV[3] << 24) | (mV[2] << 16) | (mV[1] << 8) | mV[0];
+ return (mV[VALPHA] << 24) | (mV[VBLUE] << 16) | (mV[VGREEN] << 8) | mV[VRED];
}
-inline void LLColor4U::fromRGBA( U32 aVal )
+inline void LLColor4U::fromRGBA(U32 aVal)
{
// Little endian: values are swapped in memory. The original code access the array like a U32, so we need to swap here
- mV[ 0 ] = aVal & 0xFF;
+ mV[VRED] = aVal & 0xFF;
aVal >>= 8;
- mV[ 1 ] = aVal & 0xFF;
+ mV[VGREEN] = aVal & 0xFF;
aVal >>= 8;
- mV[ 2 ] = aVal & 0xFF;
+ mV[VBLUE] = aVal & 0xFF;
aVal >>= 8;
- mV[ 3 ] = aVal & 0xFF;
+ mV[VALPHA] = aVal & 0xFF;
}
-
#endif
-
diff --git a/indra/llmath/v4math.cpp b/indra/llmath/v4math.cpp
index 0aa6eb09c3..cd475380d6 100644
--- a/indra/llmath/v4math.cpp
+++ b/indra/llmath/v4math.cpp
@@ -26,7 +26,6 @@
#include "linden_common.h"
-//#include "vmath.h"
#include "v3math.h"
#include "v4math.h"
#include "m4math.h"
@@ -36,13 +35,13 @@
// LLVector4
// Axis-Angle rotations
-const LLVector4& LLVector4::rotVec(const LLMatrix4 &mat)
+const LLVector4& LLVector4::rotVec(const LLMatrix4& mat)
{
*this = *this * mat;
return *this;
}
-const LLVector4& LLVector4::rotVec(const LLQuaternion &q)
+const LLVector4& LLVector4::rotVec(const LLQuaternion& q)
{
*this = *this * q;
return *this;
@@ -64,16 +63,16 @@ bool LLVector4::abs()
{
bool ret{ false };
- if (mV[0] < 0.f) { mV[0] = -mV[0]; ret = true; }
- if (mV[1] < 0.f) { mV[1] = -mV[1]; ret = true; }
- if (mV[2] < 0.f) { mV[2] = -mV[2]; ret = true; }
- if (mV[3] < 0.f) { mV[3] = -mV[3]; ret = true; }
+ if (mV[VX] < 0.f) { mV[VX] = -mV[VX]; ret = true; }
+ if (mV[VY] < 0.f) { mV[VY] = -mV[VY]; ret = true; }
+ if (mV[VZ] < 0.f) { mV[VZ] = -mV[VZ]; ret = true; }
+ if (mV[VW] < 0.f) { mV[VW] = -mV[VW]; ret = true; }
return ret;
}
-std::ostream& operator<<(std::ostream& s, const LLVector4 &a)
+std::ostream& operator<<(std::ostream& s, const LLVector4& a)
{
s << "{ " << a.mV[VX] << ", " << a.mV[VY] << ", " << a.mV[VZ] << ", " << a.mV[VW] << " }";
return s;
@@ -108,12 +107,12 @@ bool are_parallel(const LLVector4 &a, const LLVector4 &b, F32 epsilon)
}
-LLVector3 vec4to3(const LLVector4 &vec)
+LLVector3 vec4to3(const LLVector4& vec)
{
return LLVector3( vec.mV[VX], vec.mV[VY], vec.mV[VZ] );
}
-LLVector4 vec3to4(const LLVector3 &vec)
+LLVector4 vec3to4(const LLVector3& vec)
{
return LLVector4(vec.mV[VX], vec.mV[VY], vec.mV[VZ]);
}
diff --git a/indra/llmath/v4math.h b/indra/llmath/v4math.h
index a4c9668fdd..d49639bd35 100644
--- a/indra/llmath/v4math.h
+++ b/indra/llmath/v4math.h
@@ -42,108 +42,110 @@ class LLQuaternion;
// LLVector4 = |x y z w|
-static const U32 LENGTHOFVECTOR4 = 4;
+static constexpr U32 LENGTHOFVECTOR4 = 4;
class LLVector4
{
- public:
- F32 mV[LENGTHOFVECTOR4];
- LLVector4(); // Initializes LLVector4 to (0, 0, 0, 1)
- explicit LLVector4(const F32 *vec); // Initializes LLVector4 to (vec[0]. vec[1], vec[2], vec[3])
- explicit LLVector4(const F64 *vec); // Initialized LLVector4 to ((F32) vec[0], (F32) vec[1], (F32) vec[3], (F32) vec[4]);
- explicit LLVector4(const LLVector2 &vec);
- explicit LLVector4(const LLVector2 &vec, F32 z, F32 w);
- explicit LLVector4(const LLVector3 &vec); // Initializes LLVector4 to (vec, 1)
- explicit LLVector4(const LLVector3 &vec, F32 w); // Initializes LLVector4 to (vec, w)
- explicit LLVector4(const LLSD &sd);
- LLVector4(F32 x, F32 y, F32 z); // Initializes LLVector4 to (x. y, z, 1)
- LLVector4(F32 x, F32 y, F32 z, F32 w);
-
- LLSD getValue() const
- {
- LLSD ret;
- ret[0] = mV[0];
- ret[1] = mV[1];
- ret[2] = mV[2];
- ret[3] = mV[3];
- return ret;
- }
-
- void setValue(const LLSD& sd)
- {
- mV[0] = (F32)sd[0].asReal();
- mV[1] = (F32)sd[1].asReal();
- mV[2] = (F32)sd[2].asReal();
- mV[3] = (F32)sd[3].asReal();
- }
-
- // GLM interop
- explicit LLVector4(const glm::vec3& vec); // Initializes LLVector4 to (vec, 1)
- explicit LLVector4(const glm::vec4& vec); // Initializes LLVector4 to vec
- explicit operator glm::vec3() const; // Initializes glm::vec3 to (vec[0]. vec[1], vec[2])
- explicit operator glm::vec4() const; // Initializes glm::vec4 to (vec[0]. vec[1], vec[2], vec[3])
-
- inline bool isFinite() const; // checks to see if all values of LLVector3 are finite
-
- inline void clear(); // Clears LLVector4 to (0, 0, 0, 1)
- inline void clearVec(); // deprecated
- inline void zeroVec(); // deprecated
-
- inline void set(F32 x, F32 y, F32 z); // Sets LLVector4 to (x, y, z, 1)
- inline void set(F32 x, F32 y, F32 z, F32 w); // Sets LLVector4 to (x, y, z, w)
- inline void set(const LLVector4 &vec); // Sets LLVector4 to vec
- inline void set(const LLVector3 &vec, F32 w = 1.f); // Sets LLVector4 to LLVector3 vec
- inline void set(const F32 *vec); // Sets LLVector4 to vec
- inline void set(const glm::vec4& vec); // Sets LLVector4 to vec
- inline void set(const glm::vec3& vec, F32 w = 1.f); // Sets LLVector4 to LLVector3 vec with w defaulted to 1
-
- inline void setVec(F32 x, F32 y, F32 z); // deprecated
- inline void setVec(F32 x, F32 y, F32 z, F32 w); // deprecated
- inline void setVec(const LLVector4 &vec); // deprecated
- inline void setVec(const LLVector3 &vec, F32 w = 1.f); // deprecated
- inline void setVec(const F32 *vec); // deprecated
-
- F32 length() const; // Returns magnitude of LLVector4
- F32 lengthSquared() const; // Returns magnitude squared of LLVector4
- F32 normalize(); // Normalizes and returns the magnitude of LLVector4
-
- F32 magVec() const; // deprecated
- F32 magVecSquared() const; // deprecated
- F32 normVec(); // deprecated
-
- // Sets all values to absolute value of their original values
- // Returns true if data changed
- bool abs();
-
- bool isExactlyClear() const { return (mV[VW] == 1.0f) && !mV[VX] && !mV[VY] && !mV[VZ]; }
- bool isExactlyZero() const { return !mV[VW] && !mV[VX] && !mV[VY] && !mV[VZ]; }
-
- const LLVector4& rotVec(const LLMatrix4 &mat); // Rotates by MAT4 mat
- const LLVector4& rotVec(const LLQuaternion &q); // Rotates by QUAT q
-
- const LLVector4& scaleVec(const LLVector4& vec); // Scales component-wise by vec
-
- F32 operator[](int idx) const { return mV[idx]; }
- F32 &operator[](int idx) { return mV[idx]; }
-
- friend std::ostream& operator<<(std::ostream& s, const LLVector4 &a); // Print a
- friend LLVector4 operator+(const LLVector4 &a, const LLVector4 &b); // Return vector a + b
- friend LLVector4 operator-(const LLVector4 &a, const LLVector4 &b); // Return vector a minus b
- friend F32 operator*(const LLVector4 &a, const LLVector4 &b); // Return a dot b
- friend LLVector4 operator%(const LLVector4 &a, const LLVector4 &b); // Return a cross b
- friend LLVector4 operator/(const LLVector4 &a, F32 k); // Return a divided by scaler k
- friend LLVector4 operator*(const LLVector4 &a, F32 k); // Return a times scaler k
- friend LLVector4 operator*(F32 k, const LLVector4 &a); // Return a times scaler k
- friend bool operator==(const LLVector4 &a, const LLVector4 &b); // Return a == b
- friend bool operator!=(const LLVector4 &a, const LLVector4 &b); // Return a != b
-
- friend const LLVector4& operator+=(LLVector4 &a, const LLVector4 &b); // Return vector a + b
- friend const LLVector4& operator-=(LLVector4 &a, const LLVector4 &b); // Return vector a minus b
- friend const LLVector4& operator%=(LLVector4 &a, const LLVector4 &b); // Return a cross b
- friend const LLVector4& operator*=(LLVector4 &a, F32 k); // Return a times scaler k
- friend const LLVector4& operator/=(LLVector4 &a, F32 k); // Return a divided by scaler k
-
- friend LLVector4 operator-(const LLVector4 &a); // Return vector -a
+public:
+ F32 mV[LENGTHOFVECTOR4];
+ LLVector4(); // Initializes LLVector4 to (0, 0, 0, 1)
+ explicit LLVector4(const F32 *vec); // Initializes LLVector4 to (vec[0]. vec[1], vec[2], vec[3])
+ explicit LLVector4(const F64 *vec); // Initialized LLVector4 to ((F32) vec[0], (F32) vec[1], (F32) vec[3], (F32) vec[4]);
+ explicit LLVector4(const LLVector2 &vec);
+ explicit LLVector4(const LLVector2 &vec, F32 z, F32 w);
+ explicit LLVector4(const LLVector3 &vec); // Initializes LLVector4 to (vec, 1)
+ explicit LLVector4(const LLVector3 &vec, F32 w); // Initializes LLVector4 to (vec, w)
+ explicit LLVector4(const LLSD &sd);
+ LLVector4(F32 x, F32 y, F32 z); // Initializes LLVector4 to (x. y, z, 1)
+ LLVector4(F32 x, F32 y, F32 z, F32 w);
+
+ LLSD getValue() const
+ {
+ LLSD ret;
+ ret[VX] = mV[VX];
+ ret[VY] = mV[VY];
+ ret[VZ] = mV[VZ];
+ ret[VW] = mV[VW];
+ return ret;
+ }
+
+ void setValue(const LLSD& sd)
+ {
+ mV[VX] = (F32)sd[VX].asReal();
+ mV[VY] = (F32)sd[VY].asReal();
+ mV[VZ] = (F32)sd[VZ].asReal();
+ mV[VW] = (F32)sd[VW].asReal();
+ }
+
+ // GLM interop
+ explicit LLVector4(const glm::vec3& vec); // Initializes LLVector4 to (vec, 1)
+ explicit LLVector4(const glm::vec4& vec); // Initializes LLVector4 to vec
+ explicit operator glm::vec3() const; // Initializes glm::vec3 to (vec[0]. vec[1], vec[2])
+ explicit operator glm::vec4() const; // Initializes glm::vec4 to (vec[0]. vec[1], vec[2], vec[3])
+
+ inline bool isFinite() const; // checks to see if all values of LLVector3 are finite
+
+ inline void clear(); // Clears LLVector4 to (0, 0, 0, 1)
+ inline void clearVec(); // deprecated
+ inline void zeroVec(); // deprecated
+
+ inline void set(F32 x, F32 y, F32 z); // Sets LLVector4 to (x, y, z, 1)
+ inline void set(F32 x, F32 y, F32 z, F32 w); // Sets LLVector4 to (x, y, z, w)
+ inline void set(const LLVector4 &vec); // Sets LLVector4 to vec
+ inline void set(const LLVector3 &vec, F32 w = 1.f); // Sets LLVector4 to LLVector3 vec
+ inline void set(const F32 *vec); // Sets LLVector4 to vec
+ inline void set(const glm::vec4& vec); // Sets LLVector4 to vec
+ inline void set(const glm::vec3& vec, F32 w = 1.f); // Sets LLVector4 to LLVector3 vec with w defaulted to 1
+
+ inline void setVec(F32 x, F32 y, F32 z); // deprecated
+ inline void setVec(F32 x, F32 y, F32 z, F32 w); // deprecated
+ inline void setVec(const LLVector4 &vec); // deprecated
+ inline void setVec(const LLVector3 &vec, F32 w = 1.f); // deprecated
+ inline void setVec(const F32 *vec); // deprecated
+
+ F32 length() const; // Returns magnitude of LLVector4
+ F32 lengthSquared() const; // Returns magnitude squared of LLVector4
+ F32 normalize(); // Normalizes and returns the magnitude of LLVector4
+
+ F32 magVec() const; // deprecated
+ F32 magVecSquared() const; // deprecated
+ F32 normVec(); // deprecated
+
+ // Sets all values to absolute value of their original values
+ // Returns true if data changed
+ bool abs();
+
+ bool isExactlyClear() const { return (mV[VW] == 1.0f) && !mV[VX] && !mV[VY] && !mV[VZ]; }
+ bool isExactlyZero() const { return !mV[VW] && !mV[VX] && !mV[VY] && !mV[VZ]; }
+
+ const LLVector4& rotVec(F32 angle, const LLVector4 &vec); // Rotates about vec by angle radians
+ const LLVector4& rotVec(F32 angle, F32 x, F32 y, F32 z); // Rotates about x,y,z by angle radians
+ const LLVector4& rotVec(const LLMatrix4 &mat); // Rotates by MAT4 mat
+ const LLVector4& rotVec(const LLQuaternion &q); // Rotates by QUAT q
+
+ const LLVector4& scaleVec(const LLVector4& vec); // Scales component-wise by vec
+
+ F32 operator[](int idx) const { return mV[idx]; }
+ F32 &operator[](int idx) { return mV[idx]; }
+
+ friend std::ostream& operator<<(std::ostream& s, const LLVector4 &a); // Print a
+ friend LLVector4 operator+(const LLVector4 &a, const LLVector4 &b); // Return vector a + b
+ friend LLVector4 operator-(const LLVector4 &a, const LLVector4 &b); // Return vector a minus b
+ friend F32 operator*(const LLVector4 &a, const LLVector4 &b); // Return a dot b
+ friend LLVector4 operator%(const LLVector4 &a, const LLVector4 &b); // Return a cross b
+ friend LLVector4 operator/(const LLVector4 &a, F32 k); // Return a divided by scaler k
+ friend LLVector4 operator*(const LLVector4 &a, F32 k); // Return a times scaler k
+ friend LLVector4 operator*(F32 k, const LLVector4 &a); // Return a times scaler k
+ friend bool operator==(const LLVector4 &a, const LLVector4 &b); // Return a == b
+ friend bool operator!=(const LLVector4 &a, const LLVector4 &b); // Return a != b
+
+ friend const LLVector4& operator+=(LLVector4 &a, const LLVector4 &b); // Return vector a + b
+ friend const LLVector4& operator-=(LLVector4 &a, const LLVector4 &b); // Return vector a minus b
+ friend const LLVector4& operator%=(LLVector4 &a, const LLVector4 &b); // Return a cross b
+ friend const LLVector4& operator*=(LLVector4 &a, F32 k); // Return a times scaler k
+ friend const LLVector4& operator/=(LLVector4 &a, F32 k); // Return a divided by scaler k
+
+ friend LLVector4 operator-(const LLVector4 &a); // Return vector -a
};
// Non-member functions
@@ -159,34 +161,22 @@ LLVector4 lerp(const LLVector4 &a, const LLVector4 &b, F32 u); // Returns a vect
inline LLVector4::LLVector4(void)
{
- mV[VX] = 0.f;
- mV[VY] = 0.f;
- mV[VZ] = 0.f;
- mV[VW] = 1.f;
+ clear();
}
inline LLVector4::LLVector4(F32 x, F32 y, F32 z)
{
- mV[VX] = x;
- mV[VY] = y;
- mV[VZ] = z;
- mV[VW] = 1.f;
+ set(x, y, z, 1.f);
}
inline LLVector4::LLVector4(F32 x, F32 y, F32 z, F32 w)
{
- mV[VX] = x;
- mV[VY] = y;
- mV[VZ] = z;
- mV[VW] = w;
+ set(x, y, z, w);
}
inline LLVector4::LLVector4(const F32 *vec)
{
- mV[VX] = vec[VX];
- mV[VY] = vec[VY];
- mV[VZ] = vec[VZ];
- mV[VW] = vec[VW];
+ set(vec);
}
inline LLVector4::LLVector4(const F64 *vec)
@@ -215,18 +205,12 @@ inline LLVector4::LLVector4(const LLVector2 &vec, F32 z, F32 w)
inline LLVector4::LLVector4(const LLVector3 &vec)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
- mV[VZ] = vec.mV[VZ];
- mV[VW] = 1.f;
+ set(vec, 1.f);
}
inline LLVector4::LLVector4(const LLVector3 &vec, F32 w)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
- mV[VZ] = vec.mV[VZ];
- mV[VW] = w;
+ set(vec, w);
}
inline LLVector4::LLVector4(const LLSD &sd)
@@ -252,43 +236,31 @@ inline LLVector4::LLVector4(const glm::vec4& vec)
inline bool LLVector4::isFinite() const
{
- return (llfinite(mV[VX]) && llfinite(mV[VY]) && llfinite(mV[VZ]) && llfinite(mV[VW]));
+ return llfinite(mV[VX]) && llfinite(mV[VY]) && llfinite(mV[VZ]) && llfinite(mV[VW]);
}
// Clear and Assignment Functions
-inline void LLVector4::clear(void)
+inline void LLVector4::clear()
{
- mV[VX] = 0.f;
- mV[VY] = 0.f;
- mV[VZ] = 0.f;
- mV[VW] = 1.f;
+ set(0.f, 0.f, 0.f, 1.f);
}
// deprecated
-inline void LLVector4::clearVec(void)
+inline void LLVector4::clearVec()
{
- mV[VX] = 0.f;
- mV[VY] = 0.f;
- mV[VZ] = 0.f;
- mV[VW] = 1.f;
+ clear();
}
// deprecated
-inline void LLVector4::zeroVec(void)
+inline void LLVector4::zeroVec()
{
- mV[VX] = 0.f;
- mV[VY] = 0.f;
- mV[VZ] = 0.f;
- mV[VW] = 0.f;
+ set(0.f, 0.f, 0.f, 0.f);
}
inline void LLVector4::set(F32 x, F32 y, F32 z)
{
- mV[VX] = x;
- mV[VY] = y;
- mV[VZ] = z;
- mV[VW] = 1.f;
+ set(x, y, z, 1.f);
}
inline void LLVector4::set(F32 x, F32 y, F32 z, F32 w)
@@ -299,15 +271,12 @@ inline void LLVector4::set(F32 x, F32 y, F32 z, F32 w)
mV[VW] = w;
}
-inline void LLVector4::set(const LLVector4 &vec)
+inline void LLVector4::set(const LLVector4& vec)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
- mV[VZ] = vec.mV[VZ];
- mV[VW] = vec.mV[VW];
+ set(vec.mV);
}
-inline void LLVector4::set(const LLVector3 &vec, F32 w)
+inline void LLVector4::set(const LLVector3& vec, F32 w)
{
mV[VX] = vec.mV[VX];
mV[VY] = vec.mV[VY];
@@ -315,14 +284,13 @@ inline void LLVector4::set(const LLVector3 &vec, F32 w)
mV[VW] = w;
}
-inline void LLVector4::set(const F32 *vec)
+inline void LLVector4::set(const F32* vec)
{
mV[VX] = vec[VX];
mV[VY] = vec[VY];
mV[VZ] = vec[VZ];
mV[VW] = vec[VW];
}
-
inline void LLVector4::set(const glm::vec4& vec)
{
mV[VX] = vec.x;
@@ -342,119 +310,104 @@ inline void LLVector4::set(const glm::vec3& vec, F32 w)
// deprecated
inline void LLVector4::setVec(F32 x, F32 y, F32 z)
{
- mV[VX] = x;
- mV[VY] = y;
- mV[VZ] = z;
- mV[VW] = 1.f;
+ set(x, y, z);
}
// deprecated
inline void LLVector4::setVec(F32 x, F32 y, F32 z, F32 w)
{
- mV[VX] = x;
- mV[VY] = y;
- mV[VZ] = z;
- mV[VW] = w;
+ set(x, y, z, w);
}
// deprecated
-inline void LLVector4::setVec(const LLVector4 &vec)
+inline void LLVector4::setVec(const LLVector4& vec)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
- mV[VZ] = vec.mV[VZ];
- mV[VW] = vec.mV[VW];
+ set(vec);
}
// deprecated
-inline void LLVector4::setVec(const LLVector3 &vec, F32 w)
+inline void LLVector4::setVec(const LLVector3& vec, F32 w)
{
- mV[VX] = vec.mV[VX];
- mV[VY] = vec.mV[VY];
- mV[VZ] = vec.mV[VZ];
- mV[VW] = w;
+ set(vec, w);
}
// deprecated
-inline void LLVector4::setVec(const F32 *vec)
+inline void LLVector4::setVec(const F32* vec)
{
- mV[VX] = vec[VX];
- mV[VY] = vec[VY];
- mV[VZ] = vec[VZ];
- mV[VW] = vec[VW];
+ set(vec);
}
// LLVector4 Magnitude and Normalization Functions
-inline F32 LLVector4::length(void) const
+inline F32 LLVector4::length() const
{
- return (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]);
+ return sqrt(lengthSquared());
}
-inline F32 LLVector4::lengthSquared(void) const
+inline F32 LLVector4::lengthSquared() const
{
return mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ];
}
-inline F32 LLVector4::magVec(void) const
+inline F32 LLVector4::magVec() const
{
- return (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]);
+ return length();
}
-inline F32 LLVector4::magVecSquared(void) const
+inline F32 LLVector4::magVecSquared() const
{
- return mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ];
+ return lengthSquared();
}
// LLVector4 Operators
-inline LLVector4 operator+(const LLVector4 &a, const LLVector4 &b)
+inline LLVector4 operator+(const LLVector4& a, const LLVector4& b)
{
LLVector4 c(a);
return c += b;
}
-inline LLVector4 operator-(const LLVector4 &a, const LLVector4 &b)
+inline LLVector4 operator-(const LLVector4& a, const LLVector4& b)
{
LLVector4 c(a);
return c -= b;
}
-inline F32 operator*(const LLVector4 &a, const LLVector4 &b)
+inline F32 operator*(const LLVector4& a, const LLVector4& b)
{
- return (a.mV[VX]*b.mV[VX] + a.mV[VY]*b.mV[VY] + a.mV[VZ]*b.mV[VZ]);
+ return a.mV[VX]*b.mV[VX] + a.mV[VY]*b.mV[VY] + a.mV[VZ]*b.mV[VZ];
}
-inline LLVector4 operator%(const LLVector4 &a, const LLVector4 &b)
+inline LLVector4 operator%(const LLVector4& a, const LLVector4& b)
{
return LLVector4(a.mV[VY]*b.mV[VZ] - b.mV[VY]*a.mV[VZ], a.mV[VZ]*b.mV[VX] - b.mV[VZ]*a.mV[VX], a.mV[VX]*b.mV[VY] - b.mV[VX]*a.mV[VY]);
}
-inline LLVector4 operator/(const LLVector4 &a, F32 k)
+inline LLVector4 operator/(const LLVector4& a, F32 k)
{
F32 t = 1.f / k;
return LLVector4( a.mV[VX] * t, a.mV[VY] * t, a.mV[VZ] * t );
}
-inline LLVector4 operator*(const LLVector4 &a, F32 k)
+inline LLVector4 operator*(const LLVector4& a, F32 k)
{
return LLVector4( a.mV[VX] * k, a.mV[VY] * k, a.mV[VZ] * k );
}
-inline LLVector4 operator*(F32 k, const LLVector4 &a)
+inline LLVector4 operator*(F32 k, const LLVector4& a)
{
return LLVector4( a.mV[VX] * k, a.mV[VY] * k, a.mV[VZ] * k );
}
-inline bool operator==(const LLVector4 &a, const LLVector4 &b)
+inline bool operator==(const LLVector4& a, const LLVector4& b)
{
return ( (a.mV[VX] == b.mV[VX])
&&(a.mV[VY] == b.mV[VY])
&&(a.mV[VZ] == b.mV[VZ]));
}
-inline bool operator!=(const LLVector4 &a, const LLVector4 &b)
+inline bool operator!=(const LLVector4& a, const LLVector4& b)
{
return ( (a.mV[VX] != b.mV[VX])
||(a.mV[VY] != b.mV[VY])
@@ -462,7 +415,7 @@ inline bool operator!=(const LLVector4 &a, const LLVector4 &b)
||(a.mV[VW] != b.mV[VW]) );
}
-inline const LLVector4& operator+=(LLVector4 &a, const LLVector4 &b)
+inline const LLVector4& operator+=(LLVector4& a, const LLVector4& b)
{
a.mV[VX] += b.mV[VX];
a.mV[VY] += b.mV[VY];
@@ -470,7 +423,7 @@ inline const LLVector4& operator+=(LLVector4 &a, const LLVector4 &b)
return a;
}
-inline const LLVector4& operator-=(LLVector4 &a, const LLVector4 &b)
+inline const LLVector4& operator-=(LLVector4& a, const LLVector4& b)
{
a.mV[VX] -= b.mV[VX];
a.mV[VY] -= b.mV[VY];
@@ -478,14 +431,14 @@ inline const LLVector4& operator-=(LLVector4 &a, const LLVector4 &b)
return a;
}
-inline const LLVector4& operator%=(LLVector4 &a, const LLVector4 &b)
+inline const LLVector4& operator%=(LLVector4& a, const LLVector4& b)
{
LLVector4 ret(a.mV[VY]*b.mV[VZ] - b.mV[VY]*a.mV[VZ], a.mV[VZ]*b.mV[VX] - b.mV[VZ]*a.mV[VX], a.mV[VX]*b.mV[VY] - b.mV[VX]*a.mV[VY]);
a = ret;
return a;
}
-inline const LLVector4& operator*=(LLVector4 &a, F32 k)
+inline const LLVector4& operator*=(LLVector4& a, F32 k)
{
a.mV[VX] *= k;
a.mV[VY] *= k;
@@ -493,16 +446,12 @@ inline const LLVector4& operator*=(LLVector4 &a, F32 k)
return a;
}
-inline const LLVector4& operator/=(LLVector4 &a, F32 k)
+inline const LLVector4& operator/=(LLVector4& a, F32 k)
{
- F32 t = 1.f / k;
- a.mV[VX] *= t;
- a.mV[VY] *= t;
- a.mV[VZ] *= t;
- return a;
+ return a *= 1.f / k;
}
-inline LLVector4 operator-(const LLVector4 &a)
+inline LLVector4 operator-(const LLVector4& a)
{
return LLVector4( -a.mV[VX], -a.mV[VY], -a.mV[VZ] );
}
@@ -517,19 +466,19 @@ inline LLVector4::operator glm::vec4() const
return glm::make_vec4(mV);
}
-inline F32 dist_vec(const LLVector4 &a, const LLVector4 &b)
+inline F32 dist_vec(const LLVector4& a, const LLVector4& b)
{
LLVector4 vec = a - b;
- return (vec.length());
+ return vec.length();
}
-inline F32 dist_vec_squared(const LLVector4 &a, const LLVector4 &b)
+inline F32 dist_vec_squared(const LLVector4& a, const LLVector4& b)
{
LLVector4 vec = a - b;
- return (vec.lengthSquared());
+ return vec.lengthSquared();
}
-inline LLVector4 lerp(const LLVector4 &a, const LLVector4 &b, F32 u)
+inline LLVector4 lerp(const LLVector4& a, const LLVector4& b, F32 u)
{
return LLVector4(
a.mV[VX] + (b.mV[VX] - a.mV[VX]) * u,
@@ -538,59 +487,39 @@ inline LLVector4 lerp(const LLVector4 &a, const LLVector4 &b, F32 u)
a.mV[VW] + (b.mV[VW] - a.mV[VW]) * u);
}
-inline F32 LLVector4::normalize(void)
+inline F32 LLVector4::normalize()
{
- F32 mag = (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]);
- F32 oomag;
+ F32 mag = sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]);
if (mag > FP_MAG_THRESHOLD)
{
- oomag = 1.f/mag;
- mV[VX] *= oomag;
- mV[VY] *= oomag;
- mV[VZ] *= oomag;
+ *this /= mag;
}
else
{
- mV[0] = 0.f;
- mV[1] = 0.f;
- mV[2] = 0.f;
- mag = 0;
+ mV[VX] = 0.f;
+ mV[VY] = 0.f;
+ mV[VZ] = 0.f;
+ mag = 0.f;
}
- return (mag);
+ return mag;
}
// deprecated
-inline F32 LLVector4::normVec(void)
+inline F32 LLVector4::normVec()
{
- F32 mag = (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]);
- F32 oomag;
-
- if (mag > FP_MAG_THRESHOLD)
- {
- oomag = 1.f/mag;
- mV[VX] *= oomag;
- mV[VY] *= oomag;
- mV[VZ] *= oomag;
- }
- else
- {
- mV[0] = 0.f;
- mV[1] = 0.f;
- mV[2] = 0.f;
- mag = 0;
- }
- return (mag);
+ return normalize();
}
// Because apparently some parts of the viewer use this for color info.
-inline const LLVector4 srgbVector4(const LLVector4 &a) {
+inline const LLVector4 srgbVector4(const LLVector4& a)
+{
LLVector4 srgbColor;
- srgbColor.mV[0] = linearTosRGB(a.mV[0]);
- srgbColor.mV[1] = linearTosRGB(a.mV[1]);
- srgbColor.mV[2] = linearTosRGB(a.mV[2]);
- srgbColor.mV[3] = a.mV[3];
+ srgbColor.mV[VX] = linearTosRGB(a.mV[VX]);
+ srgbColor.mV[VY] = linearTosRGB(a.mV[VY]);
+ srgbColor.mV[VZ] = linearTosRGB(a.mV[VZ]);
+ srgbColor.mV[VW] = a.mV[VW];
return srgbColor;
}
diff --git a/indra/llmath/xform.h b/indra/llmath/xform.h
index 7434301670..fa45fffeae 100644
--- a/indra/llmath/xform.h
+++ b/indra/llmath/xform.h
@@ -115,7 +115,7 @@ public:
void clearChanged(U32 bits) { mChanged &= ~bits; }
void setScaleChildOffset(bool scale) { mScaleChildOffset = scale; }
- bool getScaleChildOffset() { return mScaleChildOffset; }
+ bool getScaleChildOffset() const { return mScaleChildOffset; }
LLXform* getParent() const { return mParent; }
LLXform* getRoot() const;
diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp
index c264a9f086..21dbf35783 100644
--- a/indra/llmessage/message_prehash.cpp
+++ b/indra/llmessage/message_prehash.cpp
@@ -1402,3 +1402,4 @@ char const* const _PREHASH_HoverHeight = LLMessageStringTable::getInstance()->ge
char const* const _PREHASH_Experience = LLMessageStringTable::getInstance()->getString("Experience");
char const* const _PREHASH_ExperienceID = LLMessageStringTable::getInstance()->getString("ExperienceID");
char const* const _PREHASH_LargeGenericMessage = LLMessageStringTable::getInstance()->getString("LargeGenericMessage");
+char const* const _PREHASH_MetaData = LLMessageStringTable::getInstance()->getString("MetaData");
diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h
index 1d30b69b67..8a2ad1587c 100644
--- a/indra/llmessage/message_prehash.h
+++ b/indra/llmessage/message_prehash.h
@@ -1403,5 +1403,6 @@ extern char const* const _PREHASH_HoverHeight;
extern char const* const _PREHASH_Experience;
extern char const* const _PREHASH_ExperienceID;
extern char const* const _PREHASH_LargeGenericMessage;
+extern char const* const _PREHASH_MetaData;
#endif
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index 4e3e49ec9f..2fb1956301 100644
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -66,7 +66,12 @@ LLModel::~LLModel()
{
if (mDecompID >= 0)
{
- LLConvexDecomposition::getInstance()->deleteDecomposition(mDecompID);
+ // can be null on shutdown
+ LLConvexDecomposition* decomp = LLConvexDecomposition::getInstance();
+ if (decomp)
+ {
+ decomp->deleteDecomposition(mDecompID);
+ }
}
mPhysics.mMesh.clear();
}
diff --git a/indra/llprimitive/object_flags.h b/indra/llprimitive/object_flags.h
index e2cdba072a..06e216ba49 100644
--- a/indra/llprimitive/object_flags.h
+++ b/indra/llprimitive/object_flags.h
@@ -57,16 +57,16 @@ const U32 FLAGS_CAMERA_SOURCE = (1U << 22);
//const U32 FLAGS_UNUSED_001 = (1U << 23); // was FLAGS_CAST_SHADOWS
-//const U32 FLAGS_UNUSED_002 = (1U << 24);
-//const U32 FLAGS_UNUSED_003 = (1U << 25);
-//const U32 FLAGS_UNUSED_004 = (1U << 26);
-//const U32 FLAGS_UNUSED_005 = (1U << 27);
+const U32 FLAGS_SERVER_AUTOPILOT = (1U << 24); // Update was for an agent AND that agent is being autopiloted from the server
+//const U32 FLAGS_UNUSED_002 = (1U << 25);
+//const U32 FLAGS_UNUSED_003 = (1U << 26);
+//const U32 FLAGS_UNUSED_004 = (1U << 27);
const U32 FLAGS_OBJECT_OWNER_MODIFY = (1U << 28);
const U32 FLAGS_TEMPORARY_ON_REZ = (1U << 29);
-//const U32 FLAGS_UNUSED_006 = (1U << 30); // was FLAGS_TEMPORARY
-//const U32 FLAGS_UNUSED_007 = (1U << 31); // was FLAGS_ZLIB_COMPRESSED
+//const U32 FLAGS_UNUSED_005 = (1U << 30); // was FLAGS_TEMPORARY
+//const U32 FLAGS_UNUSED_006 = (1U << 31); // was FLAGS_ZLIB_COMPRESSED
const U32 FLAGS_LOCAL = FLAGS_ANIM_SOURCE | FLAGS_CAMERA_SOURCE;
const U32 FLAGS_WORLD = FLAGS_USE_PHYSICS | FLAGS_PHANTOM | FLAGS_TEMPORARY_ON_REZ;
diff --git a/indra/llui/llaccordionctrltab.h b/indra/llui/llaccordionctrltab.h
index cf3569683e..bb0b8ce04f 100644
--- a/indra/llui/llaccordionctrltab.h
+++ b/indra/llui/llaccordionctrltab.h
@@ -126,7 +126,7 @@ public:
void setSelected(bool is_selected);
- bool getCollapsible() { return mCollapsible; };
+ bool getCollapsible() const { return mCollapsible; };
void setCollapsible(bool collapsible) { mCollapsible = collapsible; };
void changeOpenClose(bool is_open);
@@ -140,7 +140,7 @@ public:
S32 notify(const LLSD& info);
bool notifyChildren(const LLSD& info);
- void draw();
+ virtual void draw();
void storeOpenCloseState();
void restoreOpenCloseState();
@@ -181,7 +181,7 @@ public:
void setHeaderVisible(bool value);
- bool getHeaderVisible() { return mHeaderVisible;}
+ bool getHeaderVisible() const { return mHeaderVisible;}
S32 mExpandedHeight; // Height of expanded ctrl.
// Used to restore height after expand.
diff --git a/indra/llui/llchatentry.cpp b/indra/llui/llchatentry.cpp
index da5afd0386..e8d942b8af 100644
--- a/indra/llui/llchatentry.cpp
+++ b/indra/llui/llchatentry.cpp
@@ -45,7 +45,8 @@ LLChatEntry::LLChatEntry(const Params& p)
mExpandLinesCount(p.expand_lines_count),
mPrevLinesCount(0),
mSingleLineMode(false),
- mPrevExpandedLineCount(S32_MAX)
+ mPrevExpandedLineCount(S32_MAX),
+ mCurrentInput("")
{
// Initialize current history line iterator
mCurrentHistoryLine = mLineHistory.begin();
@@ -189,6 +190,7 @@ bool LLChatEntry::handleSpecialKey(const KEY key, const MASK mask)
{
needsReflow();
}
+ mCurrentInput = "";
break;
case KEY_UP:
@@ -196,6 +198,11 @@ bool LLChatEntry::handleSpecialKey(const KEY key, const MASK mask)
{
if (!mLineHistory.empty() && mCurrentHistoryLine > mLineHistory.begin())
{
+ if (mCurrentHistoryLine == mLineHistory.end())
+ {
+ mCurrentInput = getText();
+ }
+
setText(*(--mCurrentHistoryLine));
endOfDoc();
}
@@ -210,16 +217,15 @@ bool LLChatEntry::handleSpecialKey(const KEY key, const MASK mask)
case KEY_DOWN:
if (mHasHistory && MASK_CONTROL == mask)
{
- if (!mLineHistory.empty() && mCurrentHistoryLine < (mLineHistory.end() - 1) )
+ if (!mLineHistory.empty() && mCurrentHistoryLine < (mLineHistory.end() - 1))
{
setText(*(++mCurrentHistoryLine));
endOfDoc();
}
- else if (!mLineHistory.empty() && mCurrentHistoryLine == (mLineHistory.end() - 1) )
+ else if (!mLineHistory.empty() && mCurrentHistoryLine == (mLineHistory.end() - 1))
{
mCurrentHistoryLine++;
- std::string empty("");
- setText(empty);
+ setText(mCurrentInput);
needsReflow();
endOfDoc();
}
diff --git a/indra/llui/llchatentry.h b/indra/llui/llchatentry.h
index 5621ede1e7..9a0e8ee91e 100644
--- a/indra/llui/llchatentry.h
+++ b/indra/llui/llchatentry.h
@@ -101,6 +101,8 @@ private:
S32 mExpandLinesCount;
S32 mPrevLinesCount;
S32 mPrevExpandedLineCount;
+
+ std::string mCurrentInput;
};
#endif /* LLCHATENTRY_H_ */
diff --git a/indra/llui/llcheckboxctrl.h b/indra/llui/llcheckboxctrl.h
index 135f128692..4068741978 100644
--- a/indra/llui/llcheckboxctrl.h
+++ b/indra/llui/llcheckboxctrl.h
@@ -36,8 +36,8 @@
// Constants
//
-const bool RADIO_STYLE = true;
-const bool CHECK_STYLE = false;
+constexpr bool RADIO_STYLE = true;
+constexpr bool CHECK_STYLE = false;
//
// Classes
@@ -94,7 +94,7 @@ public:
// LLUICtrl interface
virtual void setValue(const LLSD& value );
virtual LLSD getValue() const;
- bool get() { return (bool)getValue().asBoolean(); }
+ bool get() const { return (bool)getValue().asBoolean(); }
void set(bool value) { setValue(value); }
virtual void setTentative(bool b);
@@ -106,7 +106,7 @@ public:
virtual void onCommit();
// LLCheckBoxCtrl interface
- virtual bool toggle() { return mButton->toggleState(); } // returns new state
+ virtual bool toggle() { return mButton->toggleState(); } // returns new state
void setBtnFocus() { mButton->setFocus(true); }
diff --git a/indra/llui/llcontainerview.h b/indra/llui/llcontainerview.h
index c6dd401e85..2675d21c22 100644
--- a/indra/llui/llcontainerview.h
+++ b/indra/llui/llcontainerview.h
@@ -65,21 +65,21 @@ protected:
public:
~LLContainerView();
- /*virtual*/ bool postBuild();
- /*virtual*/ bool addChild(LLView* view, S32 tab_group = 0);
+ bool postBuild() override;
+ bool addChild(LLView* view, S32 tab_group = 0) override;
- /*virtual*/ bool handleDoubleClick(S32 x, S32 y, MASK mask);
- /*virtual*/ bool handleMouseDown(S32 x, S32 y, MASK mask);
- /*virtual*/ bool handleMouseUp(S32 x, S32 y, MASK mask);
+ bool handleDoubleClick(S32 x, S32 y, MASK mask) override;
+ bool handleMouseDown(S32 x, S32 y, MASK mask) override;
+ bool handleMouseUp(S32 x, S32 y, MASK mask) override;
- /*virtual*/ void draw();
- /*virtual*/ void reshape(S32 width, S32 height, bool called_from_parent = true);
- /*virtual*/ LLRect getRequiredRect(); // Return the height of this object, given the set options.
+ void draw() override;
+ void reshape(S32 width, S32 height, bool called_from_parent = true) override;
+ LLRect getRequiredRect() override; // Return the height of this object, given the set options.
void setLabel(const std::string& label);
void showLabel(bool show) { mShowLabel = show; }
void setDisplayChildren(bool displayChildren);
- bool getDisplayChildren() { return mDisplayChildren; }
+ bool getDisplayChildren() const { return mDisplayChildren; }
void setScrollContainer(LLScrollContainer* scroll) {mScrollContainer = scroll;}
private:
diff --git a/indra/llui/lldockablefloater.h b/indra/llui/lldockablefloater.h
index 3effc977db..9c516e23a4 100644
--- a/indra/llui/lldockablefloater.h
+++ b/indra/llui/lldockablefloater.h
@@ -112,8 +112,8 @@ public:
virtual bool overlapsScreenChannel() { return mOverlapsScreenChannel && getVisible() && isDocked(); }
virtual void setOverlapsScreenChannel(bool overlaps) { mOverlapsScreenChannel = overlaps; }
- bool getUniqueDocking() { return mUniqueDocking; }
- bool getUseTongue() { return mUseTongue; }
+ bool getUniqueDocking() const { return mUniqueDocking; }
+ bool getUseTongue() const { return mUseTongue; }
void setUseTongue(bool use_tongue) { mUseTongue = use_tongue;}
private:
diff --git a/indra/llui/lldockcontrol.cpp b/indra/llui/lldockcontrol.cpp
index 11dbad8c09..1a00c03856 100644
--- a/indra/llui/lldockcontrol.cpp
+++ b/indra/llui/lldockcontrol.cpp
@@ -156,7 +156,7 @@ void LLDockControl::repositionDockable()
}
}
-bool LLDockControl::isDockVisible()
+bool LLDockControl::isDockVisible() const
{
bool res = true;
diff --git a/indra/llui/lldockcontrol.h b/indra/llui/lldockcontrol.h
index 7e31330713..b6ac9c19dd 100644
--- a/indra/llui/lldockcontrol.h
+++ b/indra/llui/lldockcontrol.h
@@ -61,19 +61,19 @@ public:
void off();
void forceRecalculatePosition();
void setDock(LLView* dockWidget);
- LLView* getDock()
+ LLView* getDock() const
{
return mDockWidgetHandle.get();
}
void repositionDockable();
void drawToungue();
- bool isDockVisible();
+ bool isDockVisible() const;
// gets a rect that bounds possible positions for a dockable control (EXT-1111)
void getAllowedRect(LLRect& rect);
- S32 getTongueWidth() { return mDockTongue->getWidth(); }
- S32 getTongueHeight() { return mDockTongue->getHeight(); }
+ S32 getTongueWidth() const { return mDockTongue->getWidth(); }
+ S32 getTongueHeight() const { return mDockTongue->getHeight(); }
private:
virtual void moveDockable();
diff --git a/indra/llui/lldraghandle.h b/indra/llui/lldraghandle.h
index a522e63243..73211d5292 100644
--- a/indra/llui/lldraghandle.h
+++ b/indra/llui/lldraghandle.h
@@ -66,7 +66,7 @@ public:
void setMaxTitleWidth(S32 max_width) {mMaxTitleWidth = llmin(max_width, mMaxTitleWidth); }
S32 getMaxTitleWidth() const { return mMaxTitleWidth; }
void setButtonsRect(const LLRect& rect){ mButtonsRect = rect; }
- LLRect getButtonsRect() { return mButtonsRect; }
+ LLRect getButtonsRect() const { return mButtonsRect; }
void setTitleVisible(bool visible);
virtual void setTitle( const std::string& title ) = 0;
diff --git a/indra/llui/llfiltereditor.h b/indra/llui/llfiltereditor.h
index 686827d94c..685219c9f6 100644
--- a/indra/llui/llfiltereditor.h
+++ b/indra/llui/llfiltereditor.h
@@ -49,7 +49,7 @@ protected:
LLFilterEditor(const Params&);
friend class LLUICtrlFactory;
- /*virtual*/ void handleKeystroke();
+ void handleKeystroke() override;
};
#endif // LL_FILTEREDITOR_H
diff --git a/indra/llui/llflashtimer.cpp b/indra/llui/llflashtimer.cpp
index c3db24c987..54f54653e2 100644
--- a/indra/llui/llflashtimer.cpp
+++ b/indra/llui/llflashtimer.cpp
@@ -85,12 +85,12 @@ void LLFlashTimer::stopFlashing()
mCurrentTickCount = 0;
}
-bool LLFlashTimer::isFlashingInProgress()
+bool LLFlashTimer::isFlashingInProgress() const
{
return mIsFlashingInProgress;
}
-bool LLFlashTimer::isCurrentlyHighlighted()
+bool LLFlashTimer::isCurrentlyHighlighted() const
{
return mIsCurrentlyHighlighted;
}
diff --git a/indra/llui/llflashtimer.h b/indra/llui/llflashtimer.h
index b55ce53fc0..4ef70faf2d 100644
--- a/indra/llui/llflashtimer.h
+++ b/indra/llui/llflashtimer.h
@@ -51,8 +51,8 @@ public:
void startFlashing();
void stopFlashing();
- bool isFlashingInProgress();
- bool isCurrentlyHighlighted();
+ bool isFlashingInProgress() const;
+ bool isCurrentlyHighlighted() const;
/*
* Use this instead of deleting this object.
* The next call to tick() will return true and that will destroy this object.
diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp
index 53f39766c6..8a69bd010e 100644
--- a/indra/llui/llflatlistview.cpp
+++ b/indra/llui/llflatlistview.cpp
@@ -1337,14 +1337,22 @@ void LLFlatListViewEx::updateNoItemsMessage(const std::string& filter_string)
}
}
-bool LLFlatListViewEx::getForceShowingUnmatchedItems()
+bool LLFlatListViewEx::getForceShowingUnmatchedItems() const
{
return mForceShowingUnmatchedItems;
}
-void LLFlatListViewEx::setForceShowingUnmatchedItems(bool show)
+void LLFlatListViewEx::setForceShowingUnmatchedItems(bool show, bool notify_parent)
+{
+ if (mForceShowingUnmatchedItems != show)
{
mForceShowingUnmatchedItems = show;
+ if (!mFilterSubString.empty())
+ {
+ updateNoItemsMessage(mFilterSubString);
+ filterItems(false, true);
+ }
+ }
}
void LLFlatListViewEx::setFilterSubString(const std::string& filter_str, bool notify_parent)
@@ -1412,6 +1420,7 @@ void LLFlatListViewEx::filterItems(bool re_sort, bool notify_parent)
if (visibility_changed && notify_parent)
{
+ rearrangeItems();
notifyParentItemsRectChanged();
}
}
diff --git a/indra/llui/llflatlistview.h b/indra/llui/llflatlistview.h
index 6d75e9f282..5c5621019d 100644
--- a/indra/llui/llflatlistview.h
+++ b/indra/llui/llflatlistview.h
@@ -113,7 +113,7 @@ public:
};
// disable traversal when finding widget to hand focus off to
- /*virtual*/ bool canFocusChildren() const { return false; }
+ /*virtual*/ bool canFocusChildren() const override { return false; }
/**
* Connects callback to signal called when Return key is pressed.
@@ -121,15 +121,15 @@ public:
boost::signals2::connection setReturnCallback( const commit_signal_t::slot_type& cb ) { return mOnReturnSignal.connect(cb); }
/** Overridden LLPanel's reshape, height is ignored, the list sets its height to accommodate all items */
- virtual void reshape(S32 width, S32 height, bool called_from_parent = true);
+ virtual void reshape(S32 width, S32 height, bool called_from_parent = true) override;
/** Returns full rect of child panel */
const LLRect& getItemsRect() const;
- LLRect getRequiredRect() { return getItemsRect(); }
+ LLRect getRequiredRect() override { return getItemsRect(); }
/** Returns distance between items */
- const S32 getItemsPad() { return mItemPad; }
+ const S32 getItemsPad() const { return mItemPad; }
/**
* Adds and item and LLSD value associated with it to the list at specified position
@@ -264,13 +264,13 @@ public:
void setCommitOnSelectionChange(bool b) { mCommitOnSelectionChange = b; }
/** Get number of selected items in the list */
- U32 numSelected() const {return static_cast<U32>(mSelectedItemPairs.size()); }
+ U32 numSelected() const { return static_cast<U32>(mSelectedItemPairs.size()); }
/** Get number of (visible) items in the list */
U32 size(const bool only_visible_items = true) const;
/** Removes all items from the list */
- virtual void clear();
+ virtual void clear() override;
/**
* Removes all items that can be detached from the list but doesn't destroy
@@ -294,10 +294,10 @@ public:
void scrollToShowFirstSelectedItem();
- void selectFirstItem ();
- void selectLastItem ();
+ void selectFirstItem();
+ void selectLastItem();
- virtual S32 notify(const LLSD& info) ;
+ virtual S32 notify(const LLSD& info) override;
virtual ~LLFlatListView();
@@ -346,8 +346,8 @@ protected:
virtual bool selectNextItemPair(bool is_up_direction, bool reset_selection);
- virtual bool canSelectAll() const;
- virtual void selectAll();
+ virtual bool canSelectAll() const override;
+ virtual void selectAll() override;
virtual bool isSelected(item_pair_t* item_pair) const;
@@ -364,15 +364,15 @@ protected:
*/
void notifyParentItemsRectChanged();
- virtual bool handleKeyHere(KEY key, MASK mask);
+ virtual bool handleKeyHere(KEY key, MASK mask) override;
- virtual bool postBuild();
+ virtual bool postBuild() override;
- virtual void onFocusReceived();
+ virtual void onFocusReceived() override;
- virtual void onFocusLost();
+ virtual void onFocusLost() override;
- virtual void draw();
+ virtual void draw() override;
LLRect getLastSelectedItemRect();
@@ -478,15 +478,19 @@ public:
void setNoItemsMsg(const std::string& msg) { mNoItemsMsg = msg; }
void setNoFilteredItemsMsg(const std::string& msg) { mNoFilteredItemsMsg = msg; }
- bool getForceShowingUnmatchedItems();
+ bool getForceShowingUnmatchedItems() const;
- void setForceShowingUnmatchedItems(bool show);
+ /**
+ * Sets filtered out items to stay visible. Can result in rect changes,
+ * so can notify_parent if rect changes
+ */
+ void setForceShowingUnmatchedItems(bool show, bool notify_parent);
/**
* Sets up new filter string and filters the list.
*/
void setFilterSubString(const std::string& filter_str, bool notify_parent);
- std::string getFilterSubString() { return mFilterSubString; }
+ std::string getFilterSubString() const { return mFilterSubString; }
/**
* Filters the list, rearranges and notifies parent about shape changes.
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 4b904f09e0..fd07b2ec5d 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -2165,7 +2165,7 @@ void LLFloater::setCanDrag(bool can_drag)
}
}
-bool LLFloater::getCanDrag()
+bool LLFloater::getCanDrag() const
{
return mDragHandle->getEnabled();
}
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 9be2240f6f..9e1594bdd2 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -46,24 +46,24 @@ class LLMultiFloater;
class LLFloater;
-const bool RESIZE_YES = true;
-const bool RESIZE_NO = false;
+constexpr bool RESIZE_YES = true;
+constexpr bool RESIZE_NO = false;
-const bool DRAG_ON_TOP = false;
-const bool DRAG_ON_LEFT = true;
+constexpr bool DRAG_ON_TOP = false;
+constexpr bool DRAG_ON_LEFT = true;
-const bool MINIMIZE_YES = true;
-const bool MINIMIZE_NO = false;
+constexpr bool MINIMIZE_YES = true;
+constexpr bool MINIMIZE_NO = false;
-const bool CLOSE_YES = true;
-const bool CLOSE_NO = false;
+constexpr bool CLOSE_YES = true;
+constexpr bool CLOSE_NO = false;
-const bool ADJUST_VERTICAL_YES = true;
-const bool ADJUST_VERTICAL_NO = false;
+constexpr bool ADJUST_VERTICAL_YES = true;
+constexpr bool ADJUST_VERTICAL_NO = false;
-const F32 CONTEXT_CONE_IN_ALPHA = 0.f;
-const F32 CONTEXT_CONE_OUT_ALPHA = 1.f;
-const F32 CONTEXT_CONE_FADE_TIME = .08f;
+constexpr F32 CONTEXT_CONE_IN_ALPHA = 0.f;
+constexpr F32 CONTEXT_CONE_OUT_ALPHA = 1.f;
+constexpr F32 CONTEXT_CONE_FADE_TIME = .08f;
namespace LLFloaterEnums
{
@@ -228,7 +228,7 @@ public:
/*virtual*/ void setIsChrome(bool is_chrome);
/*virtual*/ void setRect(const LLRect &rect);
void setIsSingleInstance(bool is_single_instance);
- bool getIsSingleInstance() { return mSingleInstance; }
+ bool getIsSingleInstance() const { return mSingleInstance; }
void initFloater(const Params& p);
@@ -274,17 +274,17 @@ public:
static bool isShown(const LLFloater* floater);
static bool isVisible(const LLFloater* floater);
static bool isMinimized(const LLFloater* floater);
- bool isFirstLook() { return mFirstLook; } // EXT-2653: This function is necessary to prevent overlapping for secondary showed toasts
+ bool isFirstLook() const { return mFirstLook; } // EXT-2653: This function is necessary to prevent overlapping for secondary showed toasts
virtual bool isFrontmost();
- bool isDependent() { return !mDependeeHandle.isDead(); }
+ bool isDependent() const { return !mDependeeHandle.isDead(); }
void setCanMinimize(bool can_minimize);
void setCanClose(bool can_close);
void setCanTearOff(bool can_tear_off);
virtual void setCanResize(bool can_resize);
void setCanDrag(bool can_drag);
- bool getCanDrag();
+ bool getCanDrag() const;
void setHost(LLMultiFloater* host);
- bool isResizable() const { return mResizable; }
+ bool isResizable() const { return mResizable; }
void setResizeLimits( S32 min_width, S32 min_height );
void getResizeLimits( S32* min_width, S32* min_height ) { *min_width = mMinWidth; *min_height = mMinHeight; }
@@ -347,7 +347,7 @@ public:
virtual void setDocked(bool docked, bool pop_on_undock = true);
virtual void setTornOff(bool torn_off) { mTornOff = torn_off; }
- bool isTornOff() {return mTornOff;}
+ bool isTornOff() const { return mTornOff; }
void setOpenPositioning(LLFloaterEnums::EOpenPositioning pos) {mPositioning = pos;}
@@ -377,6 +377,10 @@ public:
void enableResizeCtrls(bool enable, bool width = true, bool height = true);
bool isPositioning(LLFloaterEnums::EOpenPositioning p) const { return (p == mPositioning); }
+
+ void setAutoFocus(bool focus) { mAutoFocus = focus; } // whether to automatically take focus when opened
+ bool getAutoFocus() const { return mAutoFocus; }
+
protected:
void applyControlsAndPosition(LLFloater* other);
@@ -401,8 +405,6 @@ protected:
void setExpandedRect(const LLRect& rect) { mExpandedRect = rect; } // size when not minimized
const LLRect& getExpandedRect() const { return mExpandedRect; }
- void setAutoFocus(bool focus) { mAutoFocus = focus; } // whether to automatically take focus when opened
- bool getAutoFocus() const { return mAutoFocus; }
LLDragHandle* getDragHandle() const { return mDragHandle; }
void destroy(); // Don't call this directly. You probably want to call closeFloater()
@@ -423,7 +425,6 @@ protected:
private:
void setForeground(bool b); // called only by floaterview
void cleanupHandles(); // remove handles to dead floaters
- void createMinimizeButton();
void buildButtons(const Params& p);
// Images and tooltips are named in the XML, but we want to look them
diff --git a/indra/llui/llfloaterreglistener.h b/indra/llui/llfloaterreglistener.h
index a36072892c..28f6e7c66b 100644
--- a/indra/llui/llfloaterreglistener.h
+++ b/indra/llui/llfloaterreglistener.h
@@ -30,7 +30,6 @@
#define LL_LLFLOATERREGLISTENER_H
#include "lleventapi.h"
-#include <string>
class LLSD;
diff --git a/indra/llui/llflyoutbutton.h b/indra/llui/llflyoutbutton.h
index 7a49501318..73190fc984 100644
--- a/indra/llui/llflyoutbutton.h
+++ b/indra/llui/llflyoutbutton.h
@@ -54,7 +54,7 @@ protected:
LLFlyoutButton(const Params&);
friend class LLUICtrlFactory;
public:
- virtual void draw();
+ void draw() override;
void setToggleState(bool state);
diff --git a/indra/llui/llfocusmgr.h b/indra/llui/llfocusmgr.h
index 1fa0ac137e..89fee5c9f1 100644
--- a/indra/llui/llfocusmgr.h
+++ b/indra/llui/llfocusmgr.h
@@ -97,7 +97,7 @@ public:
LLFocusableElement* getLastKeyboardFocus() const { return mLastKeyboardFocus; }
bool childHasKeyboardFocus( const LLView* parent ) const;
void removeKeyboardFocusWithoutCallback( const LLFocusableElement* focus );
- bool getKeystrokesOnly() { return mKeystrokesOnly; }
+ bool getKeystrokesOnly() const { return mKeystrokesOnly; }
void setKeystrokesOnly(bool keystrokes_only) { mKeystrokesOnly = keystrokes_only; }
F32 getFocusFlashAmt() const;
diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h
index 7ed10d9223..368a86ea84 100644
--- a/indra/llui/llfolderview.h
+++ b/indra/llui/llfolderview.h
@@ -124,11 +124,11 @@ public:
void setSelectCallback(const signal_t::slot_type& cb) { mSelectSignal.connect(cb); }
void setReshapeCallback(const signal_t::slot_type& cb) { mReshapeSignal.connect(cb); }
- bool getAllowMultiSelect() { return mAllowMultiSelect; }
- bool getAllowDrag() { return mAllowDrag; }
+ bool getAllowMultiSelect() const { return mAllowMultiSelect; }
+ bool getAllowDrag() const { return mAllowDrag; }
void setSingleFolderMode(bool is_single_mode) { mSingleFolderMode = is_single_mode; }
- bool isSingleFolderMode() { return mSingleFolderMode; }
+ bool isSingleFolderMode() const { return mSingleFolderMode; }
// Close all folders in the view
void closeAllFolders();
@@ -142,7 +142,7 @@ public:
virtual S32 getItemHeight() const;
void arrangeAll() { mArrangeGeneration++; }
- S32 getArrangeGeneration() { return mArrangeGeneration; }
+ S32 getArrangeGeneration() const { return mArrangeGeneration; }
// applies filters to control visibility of items
virtual void filter( LLFolderViewFilter& filter);
@@ -221,33 +221,34 @@ public:
void scrollToShowSelection();
void scrollToShowItem(LLFolderViewItem* item, const LLRect& constraint_rect);
void setScrollContainer( LLScrollContainer* parent ) { mScrollContainer = parent; }
+ LLScrollContainer* getScrollContainer() { return mScrollContainer; }
LLRect getVisibleRect();
bool search(LLFolderViewItem* first_item, const std::string &search_string, bool backward);
void setShowSelectionContext(bool show) { mShowSelectionContext = show; }
bool getShowSelectionContext();
void setShowSingleSelection(bool show);
- bool getShowSingleSelection() { return mShowSingleSelection; }
- F32 getSelectionFadeElapsedTime() { return mMultiSelectionFadeTimer.getElapsedTimeF32(); }
- bool getUseEllipses() { return mUseEllipses; }
- S32 getSelectedCount() { return (S32)mSelectedItems.size(); }
+ bool getShowSingleSelection() const { return mShowSingleSelection; }
+ F32 getSelectionFadeElapsedTime() const { return mMultiSelectionFadeTimer.getElapsedTimeF32(); }
+ bool getUseEllipses() const { return mUseEllipses; }
+ S32 getSelectedCount() const { return (S32)mSelectedItems.size(); }
- void update(); // needs to be called periodically (e.g. once per frame)
+ void update(); // needs to be called periodically (e.g. once per frame)
- bool needsAutoSelect() { return mNeedsAutoSelect && !mAutoSelectOverride; }
- bool needsAutoRename() { return mNeedsAutoRename; }
+ bool needsAutoSelect() const { return mNeedsAutoSelect && !mAutoSelectOverride; }
+ bool needsAutoRename() const { return mNeedsAutoRename; }
void setNeedsAutoRename(bool val) { mNeedsAutoRename = val; }
void setPinningSelectedItem(bool val) { mPinningSelectedItem = val; }
void setAutoSelectOverride(bool val) { mAutoSelectOverride = val; }
- bool showItemLinkOverlays() { return mShowItemLinkOverlays; }
+ bool showItemLinkOverlays() const { return mShowItemLinkOverlays; }
void setCallbackRegistrar(LLUICtrl::CommitCallbackRegistry::ScopedRegistrar* registrar) { mCallbackRegistrar = registrar; }
void setEnableRegistrar(LLUICtrl::EnableCallbackRegistry::ScopedRegistrar* registrar) { mEnableRegistrar = registrar; }
void setForceArrange(bool force) { mForceArrange = force; }
- LLPanel* getParentPanel() { return mParentPanel.get(); }
+ LLPanel* getParentPanel() const { return mParentPanel.get(); }
// DEBUG only
void dumpSelectionInformation();
@@ -255,7 +256,7 @@ public:
void setShowEmptyMessage(bool show_msg) { mShowEmptyMessage = show_msg; }
- bool useLabelSuffix() { return mUseLabelSuffix; }
+ bool useLabelSuffix() const { return mUseLabelSuffix; }
virtual void updateMenu();
void finishRenamingItem( void );
@@ -391,7 +392,7 @@ public:
virtual ~LLSelectFirstFilteredItem() {}
virtual void doFolder(LLFolderViewFolder* folder);
virtual void doItem(LLFolderViewItem* item);
- bool wasItemSelected() { return mItemSelected || mFolderSelected; }
+ bool wasItemSelected() const { return mItemSelected || mFolderSelected; }
protected:
bool mItemSelected;
bool mFolderSelected;
diff --git a/indra/llui/llfolderviewitem.cpp b/indra/llui/llfolderviewitem.cpp
index 6d0cfcba95..9ca77dbe46 100644
--- a/indra/llui/llfolderviewitem.cpp
+++ b/indra/llui/llfolderviewitem.cpp
@@ -31,11 +31,12 @@
#include "llfolderviewitem.h"
#include "llfolderview.h"
#include "llfolderviewmodel.h"
-#include "llpanel.h"
#include "llcallbacklist.h"
#include "llcriticaldamp.h"
#include "llclipboard.h"
#include "llfocusmgr.h" // gFocusMgr
+#include "llnotificationsutil.h"
+#include "llpanel.h"
#include "lltrans.h"
#include "llwindow.h"
@@ -60,7 +61,11 @@ LLUIColor LLFolderViewItem::sSearchStatusColor;
S32 LLFolderViewItem::sTopPad = 0;
LLUIImagePtr LLFolderViewItem::sFolderArrowImg;
LLUIImagePtr LLFolderViewItem::sSelectionImg;
+LLUIImagePtr LLFolderViewItem::sFavoriteImg;
+LLUIImagePtr LLFolderViewItem::sFavoriteContentImg;
LLFontGL* LLFolderViewItem::sSuffixFont = nullptr;
+LLUIColor LLFolderViewItem::sFavoriteColor;
+bool LLFolderViewItem::sColorSetInitialized = false;
// only integers can be initialized in header
const F32 LLFolderViewItem::FOLDER_CLOSE_TIME_CONSTANT = 0.02f;
@@ -68,6 +73,9 @@ const F32 LLFolderViewItem::FOLDER_OPEN_TIME_CONSTANT = 0.03f;
const LLColor4U DEFAULT_WHITE(255, 255, 255);
+constexpr S32 FAVORITE_IMAGE_SIZE = 14;
+constexpr S32 FAVORITE_IMAGE_PAD = 3;
+
//static
LLFontGL* LLFolderViewItem::getLabelFontForStyle(U8 style)
@@ -102,6 +110,8 @@ void LLFolderViewItem::initClass()
sTopPad = default_params.item_top_pad;
sFolderArrowImg = default_params.folder_arrow_image;
sSelectionImg = default_params.selection_image;
+ sFavoriteImg = default_params.favorite_image;
+ sFavoriteContentImg = default_params.favorite_content_image;
sSuffixFont = getLabelFontForStyle(LLFontGL::NORMAL);
sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
@@ -121,6 +131,8 @@ void LLFolderViewItem::cleanupClass()
sFonts.clear();
sFolderArrowImg = nullptr;
sSelectionImg = nullptr;
+ sFavoriteImg = nullptr;
+ sFavoriteContentImg = nullptr;
sSuffixFont = nullptr;
}
@@ -129,13 +141,15 @@ void LLFolderViewItem::cleanupClass()
LLFolderViewItem::Params::Params()
: root(),
listener(),
+ favorite_image("favorite_image"),
+ favorite_content_image("favorite_content_image"),
folder_arrow_image("folder_arrow_image"),
folder_indentation("folder_indentation"),
selection_image("selection_image"),
item_height("item_height"),
item_top_pad("item_top_pad"),
creation_date(),
- allow_wear("allow_wear", true),
+ marketplace_item("marketplace_item", false),
allow_drop("allow_drop", true),
font_color("font_color"),
font_highlight_color("font_highlight_color"),
@@ -155,6 +169,8 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p)
: LLView(p),
mLabelWidth(0),
mLabelWidthDirty(false),
+ mIsFavorite(false),
+ mHasFavorites(false),
mSuffixNeedsRefresh(false),
mLabelPaddingRight(DEFAULT_LABEL_PADDING_RIGHT),
mParentFolder( NULL ),
@@ -175,7 +191,7 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p)
mRoot(p.root),
mViewModelItem(p.listener),
mIsMouseOverTitle(false),
- mAllowWear(p.allow_wear),
+ mMarketplaceItem(p.marketplace_item),
mAllowDrop(p.allow_drop),
mFontColor(p.font_color),
mFontHighlightColor(p.font_highlight_color),
@@ -189,6 +205,21 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p)
mMaxFolderItemOverlap(p.max_folder_item_overlap),
mDoubleClickOverride(p.double_click_override)
{
+ if (!sColorSetInitialized)
+ {
+ sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
+ sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE);
+ sFlashBgColor = LLUIColorTable::instance().getColor("MenuItemFlashBgColor", DEFAULT_WHITE);
+ sFocusOutlineColor = LLUIColorTable::instance().getColor("InventoryFocusOutlineColor", DEFAULT_WHITE);
+ sMouseOverColor = LLUIColorTable::instance().getColor("InventoryMouseOverColor", DEFAULT_WHITE);
+ sFilterBGColor = LLUIColorTable::instance().getColor("FilterBackgroundColor", DEFAULT_WHITE);
+ sFilterTextColor = LLUIColorTable::instance().getColor("FilterTextColor", DEFAULT_WHITE);
+ sSuffixColor = LLUIColorTable::instance().getColor("InventoryItemLinkColor", DEFAULT_WHITE);
+ sSearchStatusColor = LLUIColorTable::instance().getColor("InventorySearchStatusColor", DEFAULT_WHITE);
+ sFavoriteColor = LLUIColorTable::instance().getColor("InventoryFavoriteColor", DEFAULT_WHITE);
+ sColorSetInitialized = true;
+ }
+
if (mViewModelItem)
{
mViewModelItem->setFolderViewItem(this);
@@ -211,6 +242,7 @@ bool LLFolderViewItem::postBuild()
// getDisplayName() is expensive (due to internal getLabelSuffix() and name building)
// it also sets search strings so it requires a filter reset
mLabel = utf8str_to_wstring(vmi->getDisplayName());
+ mIsFavorite = vmi->isFavorite() && !vmi->isItemInTrash();
setToolTip(vmi->getName());
// Dirty the filter flag of the model from the view (CHUI-849)
@@ -325,6 +357,7 @@ void LLFolderViewItem::refresh()
mLabel = utf8str_to_wstring(vmi.getDisplayName());
mLabelFontBuffer.reset();
+ mIsFavorite = vmi.isFavorite() && !vmi.isItemInTrash();
setToolTip(vmi.getName());
// icons are slightly expensive to get, can be optimized
// see LLInventoryIcon::getIcon()
@@ -359,6 +392,8 @@ void LLFolderViewItem::refreshSuffix()
mIconOpen = vmi->getIconOpen();
mIconOverlay = vmi->getIconOverlay();
+ mIsFavorite = vmi->isFavorite() && !vmi->isItemInTrash();
+
if (mRoot->useLabelSuffix())
{
// Very Expensive!
@@ -428,6 +463,10 @@ S32 LLFolderViewItem::arrange( S32* width, S32* height )
}
mLabelWidth = getLabelXPos() + getLabelFontForStyle(mLabelStyle)->getWidth(mLabel.c_str()) + getLabelFontForStyle(LLFontGL::NORMAL)->getWidth(mLabelSuffix.c_str()) + mLabelPaddingRight;
mLabelWidthDirty = false;
+ if (mIsFavorite)
+ {
+ mLabelWidth += FAVORITE_IMAGE_SIZE + FAVORITE_IMAGE_PAD;
+ }
}
*width = llmax(*width, mLabelWidth);
@@ -554,10 +593,15 @@ void LLFolderViewItem::buildContextMenu(LLMenuGL& menu, U32 flags)
void LLFolderViewItem::openItem( void )
{
- if (mAllowWear || !getViewModelItem()->isItemWearable())
+ if (!mMarketplaceItem || !getViewModelItem()->isItemWearable())
{
getViewModelItem()->openItem();
}
+ else if (mMarketplaceItem)
+ {
+ // Wearing an object from any listing, active or not, is verbotten
+ LLNotificationsUtil::add("AlertMerchantListingCannotWear");
+ }
}
void LLFolderViewItem::rename(const std::string& new_name)
@@ -771,6 +815,45 @@ void LLFolderViewItem::drawOpenFolderArrow()
}
}
+void LLFolderViewItem::drawFavoriteIcon()
+{
+ static LLUICachedControl<bool> draw_star("InventoryFavoritesUseStar", true);
+ static LLUICachedControl<bool> draw_hollow_star("InventoryFavoritesUseHollowStar", true);
+
+ LLUIImage* favorite_image = nullptr;
+ if (draw_star && mIsFavorite)
+ {
+ favorite_image = sFavoriteImg;
+ }
+ else if (draw_hollow_star && mHasFavorites && !isOpen())
+ {
+ favorite_image = sFavoriteContentImg;
+ }
+
+ if (favorite_image)
+ {
+ S32 x_offset = 0;
+ LLScrollContainer* scroll = mRoot->getScrollContainer();
+ if (scroll)
+ {
+ S32 width = scroll->getVisibleContentRect().getWidth();
+ S32 offset = scroll->getDocPosHorizontal();
+ x_offset = width + offset;
+ }
+ else
+ {
+ x_offset = getRect().getWidth();
+ }
+ gl_draw_scaled_image(
+ x_offset - FAVORITE_IMAGE_SIZE - FAVORITE_IMAGE_PAD,
+ getRect().getHeight() - mItemHeight + FAVORITE_IMAGE_PAD,
+ FAVORITE_IMAGE_SIZE,
+ FAVORITE_IMAGE_SIZE,
+ favorite_image->getImage(),
+ sFgColor);
+ }
+}
+
/*virtual*/ bool LLFolderViewItem::isHighlightAllowed()
{
return mIsSelected;
@@ -928,6 +1011,7 @@ void LLFolderViewItem::draw()
{
drawOpenFolderArrow();
}
+ drawFavoriteIcon();
drawHighlight(show_context, filled, sHighlightBgColor, sFlashBgColor, sFocusOutlineColor, sMouseOverColor);
@@ -999,7 +1083,20 @@ void LLFolderViewItem::draw()
}
}
- LLColor4 color = (mIsSelected && filled) ? mFontHighlightColor : mFontColor;
+ static LLUICachedControl<bool> highlight_color("InventoryFavoritesColorText", true);
+ LLColor4 color;
+ if (mIsSelected && filled)
+ {
+ color = mFontHighlightColor;
+ }
+ else if (mIsFavorite && highlight_color)
+ {
+ color = sFavoriteColor;
+ }
+ else
+ {
+ color = mFontColor;
+ }
if (isFadeItem())
{
@@ -1093,7 +1190,8 @@ LLFolderViewFolder::LLFolderViewFolder( const LLFolderViewItem::Params& p ):
mIsFolderComplete(false), // folder might have children that are not loaded yet.
mAreChildrenInited(false), // folder might have children that are not built yet.
mLastArrangeGeneration( -1 ),
- mLastCalculatedWidth(0)
+ mLastCalculatedWidth(0),
+ mFavoritesDirtyFlags(0)
{
}
@@ -1119,6 +1217,11 @@ LLFolderViewFolder::~LLFolderViewFolder( void )
// The LLView base class takes care of object destruction. make sure that we
// don't have mouse or keyboard focus
gFocusMgr.releaseFocusIfNeeded( this ); // calls onCommit()
+
+ if (mFavoritesDirtyFlags)
+ {
+ gIdleCallbacks.deleteFunction(&LLFolderViewFolder::onIdleUpdateFavorites, this);
+ }
}
// addToFolder() returns true if it succeeds. false otherwise
@@ -1762,6 +1865,140 @@ bool LLFolderViewFolder::isMovable()
return true;
}
+void LLFolderViewFolder::updateHasFavorites(bool new_childs_value)
+{
+ if (mFavoritesDirtyFlags == 0)
+ {
+ gIdleCallbacks.addFunction(&LLFolderViewFolder::onIdleUpdateFavorites, this);
+ }
+ if (new_childs_value)
+ {
+ mFavoritesDirtyFlags |= FAVORITE_ADDED;
+ }
+ else
+ {
+ mFavoritesDirtyFlags |= FAVORITE_REMOVED;
+ }
+}
+
+void LLFolderViewFolder::onIdleUpdateFavorites(void* data)
+{
+ LLFolderViewFolder* self = reinterpret_cast<LLFolderViewFolder*>(data);
+ if (self->mFavoritesDirtyFlags == 0)
+ {
+ // already processed either on previous run or by a different callback
+ gIdleCallbacks.deleteFunction(&LLFolderViewFolder::onIdleUpdateFavorites, self);
+ return;
+ }
+
+ if (self->getViewModelItem()->isItemInTrash())
+ {
+ // do not display favorite-stars in trash
+ self->mFavoritesDirtyFlags = 0;
+ gIdleCallbacks.deleteFunction(&LLFolderViewFolder::onIdleUpdateFavorites, self);
+ return;
+ }
+
+ if (self->mFavoritesDirtyFlags == FAVORITE_ADDED)
+ {
+ if (!self->mHasFavorites)
+ {
+ // propagate up, exclude root
+ LLFolderViewFolder* parent = self;
+ while (parent
+ && (!parent->hasFavorites() || parent->mFavoritesDirtyFlags)
+ && !parent->getViewModelItem()->isAgentInventoryRoot())
+ {
+ parent->setHasFavorites(true);
+ if (parent->mFavoritesDirtyFlags)
+ {
+ // Parent will remove onIdleUpdateFavorites later, don't remove now,
+ // We are inside gIdleCallbacks. Removing 'self' callback is safe,
+ // but removing 'parent' can invalidate following iterator
+ parent->mFavoritesDirtyFlags = 0;
+ }
+ parent = parent->getParentFolder();
+ }
+ }
+ else
+ {
+ // already up to date
+ self->mFavoritesDirtyFlags = 0;
+ gIdleCallbacks.deleteFunction(&LLFolderViewFolder::onIdleUpdateFavorites, self);
+ }
+ }
+ else if (self->mFavoritesDirtyFlags > FAVORITE_ADDED)
+ {
+ // full check
+ LLFolderViewFolder* parent = self;
+ while (parent && !parent->getViewModelItem()->isAgentInventoryRoot())
+ {
+ bool has_favorites = false;
+ for (items_t::iterator iter = parent->mItems.begin();
+ iter != parent->mItems.end();)
+ {
+ items_t::iterator iit = iter++;
+ if ((*iit)->isFavorite())
+ {
+ has_favorites = true;
+ break;
+ }
+ }
+
+ for (folders_t::iterator iter = parent->mFolders.begin();
+ iter != parent->mFolders.end() && !has_favorites;)
+ {
+ folders_t::iterator fit = iter++;
+ if ((*fit)->isFavorite() || (*fit)->hasFavorites())
+ {
+ has_favorites = true;
+ break;
+ }
+ }
+
+ if (!has_favorites)
+ {
+ if (parent->hasFavorites())
+ {
+ parent->setHasFavorites(false);
+ }
+ else
+ {
+ // Nothing changed
+ break;
+ }
+ }
+ else
+ {
+ // propagate up, exclude root
+ while (parent
+ && (!parent->hasFavorites() || parent->mFavoritesDirtyFlags)
+ && !parent->getViewModelItem()->isAgentInventoryRoot())
+ {
+ parent->setHasFavorites(true);
+ if (parent->mFavoritesDirtyFlags)
+ {
+ // Parent will remove onIdleUpdateFavorites later, don't remove now,
+ // We are inside gIdleCallbacks. Removing 'self' callback is safe,
+ // but removing 'parent' can invalidate following iterator
+ parent->mFavoritesDirtyFlags = 0;
+ }
+ parent = parent->getParentFolder();
+ }
+ break;
+ }
+ if (parent->mFavoritesDirtyFlags)
+ {
+ // Parent will remove onIdleUpdateFavorites later, don't remove now.
+ // We are inside gIdleCallbacks. Removing 'self' callback is safe,
+ // but removing 'parent' can invalidate following iterator
+ parent->mFavoritesDirtyFlags = 0;
+ }
+ parent = parent->getParentFolder();
+ }
+ }
+}
+
bool LLFolderViewFolder::isRemovable()
{
diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h
index cc8a7d934c..b0a4aec49e 100644
--- a/indra/llui/llfolderviewitem.h
+++ b/indra/llui/llfolderviewitem.h
@@ -50,7 +50,9 @@ class LLFolderViewItem : public LLView
public:
struct Params : public LLInitParam::Block<Params, LLView::Params>
{
- Optional<LLUIImage*> folder_arrow_image,
+ Optional<LLUIImage*> favorite_image,
+ favorite_content_image,
+ folder_arrow_image,
selection_image;
Mandatory<LLFolderView*> root;
Mandatory<LLFolderViewModelItem*> listener;
@@ -60,7 +62,7 @@ public:
item_top_pad;
Optional<time_t> creation_date;
- Optional<bool> allow_wear;
+ Optional<bool> marketplace_item;
Optional<bool> allow_drop;
Optional<LLUIColor> font_color;
@@ -93,6 +95,8 @@ protected:
LLWString mLabel;
S32 mLabelWidth;
bool mLabelWidthDirty;
+ bool mIsFavorite;
+ bool mHasFavorites;
S32 mLabelPaddingRight;
LLFolderViewFolder* mParentFolder;
LLPointer<LLFolderViewModelItem> mViewModelItem;
@@ -122,7 +126,7 @@ protected:
mIsCurSelection,
mDragAndDropTarget,
mIsMouseOverTitle,
- mAllowWear,
+ mMarketplaceItem,
mAllowDrop,
mSingleFolderMode,
mDoubleClickOverride,
@@ -133,6 +137,7 @@ protected:
LLUIColor mFontColor;
LLUIColor mFontHighlightColor;
+ static bool sColorSetInitialized;
// For now assuming all colors are the same in derived classes.
static LLUIColor sFgColor;
@@ -145,6 +150,8 @@ protected:
static LLUIColor sFilterTextColor;
static LLUIColor sSuffixColor;
static LLUIColor sSearchStatusColor;
+ static LLUIColor sFavoriteColor;
+
// this is an internal method used for adding items to folders. A
// no-op at this level, but reimplemented in derived classes.
@@ -208,6 +215,8 @@ public:
// Returns true is this object and all of its children can be moved
virtual bool isMovable();
+ bool isFavorite() const { return mIsFavorite; }
+
// destroys this item recursively
virtual void destroyView();
@@ -282,7 +291,7 @@ public:
// Does not need filter update
virtual void refreshSuffix();
- bool isSingleFolderMode() { return mSingleFolderMode; }
+ bool isSingleFolderMode() const { return mSingleFolderMode; }
// LLView functionality
virtual bool handleRightMouseDown( S32 x, S32 y, MASK mask );
@@ -298,6 +307,7 @@ public:
// virtual void handleDropped();
virtual void draw();
void drawOpenFolderArrow();
+ void drawFavoriteIcon();
void drawHighlight(bool showContent, bool hasKeyboardFocus, const LLUIColor& selectColor, const LLUIColor& flashColor, const LLUIColor& outlineColor, const LLUIColor& mouseOverColor);
void drawLabel(const LLFontGL* font, const F32 x, const F32 y, const LLColor4& color, F32 &right_x);
virtual bool handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop,
@@ -311,6 +321,8 @@ private:
static S32 sTopPad;
static LLUIImagePtr sFolderArrowImg;
static LLUIImagePtr sSelectionImg;
+ static LLUIImagePtr sFavoriteImg;
+ static LLUIImagePtr sFavoriteContentImg;
static LLFontGL* sSuffixFont;
LLFontVertexBuffer mLabelFontBuffer;
@@ -400,6 +412,18 @@ public:
// Returns true is this object and all of its children can be moved
virtual bool isMovable();
+ bool isFavorite() const { return mIsFavorite; }
+ bool hasFavorites() const { return mHasFavorites; }
+ void setHasFavorites(bool val) { mHasFavorites = val; }
+ void updateHasFavorites(bool new_childs_value);
+private:
+ static void onIdleUpdateFavorites(void* data);
+
+ constexpr static S32 FAVORITE_ADDED = 1;
+ constexpr static S32 FAVORITE_REMOVED = 2;
+ S32 mFavoritesDirtyFlags { 0 };
+public:
+
// destroys this folder, and all children
virtual void destroyView();
void destroyRoot();
@@ -415,9 +439,6 @@ public:
// doesn't delete it.
virtual void extractItem( LLFolderViewItem* item, bool deparent_model = true);
- // This function is called by a child that needs to be resorted.
- void resort(LLFolderViewItem* item);
-
void setAutoOpenCountdown(F32 countdown) { mAutoOpenCountdown = countdown; }
// folders can be opened. This will usually be called by internal
diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h
index 9372818ca5..ba9d0b8de3 100644
--- a/indra/llui/llfolderviewmodel.h
+++ b/indra/llui/llfolderviewmodel.h
@@ -162,6 +162,7 @@ public:
virtual void navigateToFolder(bool new_window = false, bool change_mode = false) = 0;
+ virtual bool isFavorite() const = 0;
virtual bool isItemWearable() const { return false; }
virtual bool isItemRenameable() const = 0;
@@ -170,7 +171,8 @@ public:
virtual bool isItemMovable( void ) const = 0; // Can be moved to another folder
virtual void move( LLFolderViewModelItem* parent_listener ) = 0;
- virtual bool isItemRemovable( bool check_worn = true ) const = 0; // Can be destroyed
+ virtual bool isItemRemovable( bool check_worn = true) const = 0; // Can be destroyed
+ virtual bool isItemInTrash(void) const = 0;
virtual bool removeItem() = 0;
virtual void removeBatch(std::vector<LLFolderViewModelItem*>& batch) = 0;
@@ -183,6 +185,9 @@ public:
virtual void pasteFromClipboard() = 0;
virtual void pasteLinkFromClipboard() = 0;
+ virtual bool isAgentInventory() const = 0;
+ virtual bool isAgentInventoryRoot() const = 0;
+
virtual void buildContextMenu(LLMenuGL& menu, U32 flags) = 0;
virtual bool potentiallyVisible() = 0; // is the item definitely visible or we haven't made up our minds yet?
diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp
index 7bf43c22c1..2bea8fb4ed 100644
--- a/indra/llui/llkeywords.cpp
+++ b/indra/llui/llkeywords.cpp
@@ -170,7 +170,7 @@ std::string LLKeywords::getAttribute(std::string_view key)
return (it != mAttributes.end()) ? it->second : "";
}
-LLUIColor LLKeywords::getColorGroup(std::string_view key_in)
+LLUIColor LLKeywords::getColorGroup(std::string_view key_in) const
{
std::string color_group = "ScriptText";
if (key_in == "functions")
diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h
index 328561c92a..5892238593 100644
--- a/indra/llui/llkeywords.h
+++ b/indra/llui/llkeywords.h
@@ -111,8 +111,8 @@ public:
~LLKeywords();
void clearLoaded() { mLoaded = false; }
- LLUIColor getColorGroup(std::string_view key_in);
- bool isLoaded() const { return mLoaded; }
+ LLUIColor getColorGroup(std::string_view key_in) const;
+ bool isLoaded() const { return mLoaded; }
void findSegments(std::vector<LLTextSegmentPtr> *seg_list,
const LLWString& text,
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 1c59938f90..fe0591ce4b 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -36,8 +36,8 @@
#include "lliconctrl.h"
#include "boost/foreach.hpp"
-static const F32 MIN_FRACTIONAL_SIZE = 0.00001f;
-static const F32 MAX_FRACTIONAL_SIZE = 1.f;
+static constexpr F32 MIN_FRACTIONAL_SIZE = 0.00001f;
+static constexpr F32 MAX_FRACTIONAL_SIZE = 1.f;
static LLDefaultChildRegistry::Register<LLLayoutStack> register_layout_stack("layout_stack");
static LLLayoutStack::LayoutStackRegistry::Register<LLLayoutPanel> register_layout_panel("layout_panel");
diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h
index 8459921c60..9e3536aaff 100644
--- a/indra/llui/lllayoutstack.h
+++ b/indra/llui/lllayoutstack.h
@@ -75,9 +75,6 @@ public:
/*virtual*/ bool addChild(LLView* child, S32 tab_group = 0);
/*virtual*/ void reshape(S32 width, S32 height, bool called_from_parent = true);
-
- static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node = NULL);
-
typedef enum e_animate
{
NO_ANIMATE,
@@ -86,7 +83,7 @@ public:
void addPanel(LLLayoutPanel* panel, EAnimate animate = NO_ANIMATE);
void collapsePanel(LLPanel* panel, bool collapsed = true);
- S32 getNumPanels() { return static_cast<S32>(mPanels.size()); }
+ S32 getNumPanels() const { return static_cast<S32>(mPanels.size()); }
void updateLayout();
@@ -190,7 +187,6 @@ public:
bool isCollapsed() const { return mCollapsed;}
void setOrientation(LLView::EOrientation orientation);
- void storeOriginalDim();
void setIgnoreReshape(bool ignore) { mIgnoreReshape = ignore; }
diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h
index 12fe800acb..7533f76f1d 100644
--- a/indra/llui/lllineeditor.h
+++ b/indra/llui/lllineeditor.h
@@ -306,8 +306,6 @@ public:
S32 calcCursorPos(S32 mouse_x);
bool handleSpecialKey(KEY key, MASK mask);
bool handleSelectionKey(KEY key, MASK mask);
- bool handleControlKey(KEY key, MASK mask);
- S32 handleCommitKey(KEY key, MASK mask);
void updateTextPadding();
// Draw the background image depending on enabled/focused state.
@@ -444,7 +442,7 @@ private:
mText = ed->getText();
}
- void doRollback( LLLineEditor* ed )
+ void doRollback(LLLineEditor* ed) const
{
ed->mCursorPos = mCursorPos;
ed->mScrollHPos = mScrollHPos;
@@ -455,7 +453,7 @@ private:
ed->mPrevText = mText;
}
- std::string getText() { return mText; }
+ std::string getText() const { return mText; }
private:
std::string mText;
diff --git a/indra/llui/llmenubutton.h b/indra/llui/llmenubutton.h
index a77ae7dae7..3f96b28246 100644
--- a/indra/llui/llmenubutton.h
+++ b/indra/llui/llmenubutton.h
@@ -65,8 +65,8 @@ public:
boost::signals2::connection setMouseDownCallback( const mouse_signal_t::slot_type& cb );
- /*virtual*/ bool handleMouseDown(S32 x, S32 y, MASK mask);
- /*virtual*/ bool handleKeyHere(KEY key, MASK mask );
+ bool handleMouseDown(S32 x, S32 y, MASK mask) override;
+ bool handleKeyHere(KEY key, MASK mask) override;
void hideMenu();
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index c11b42a348..2ca2454040 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -46,6 +46,7 @@
#include "llfocusmgr.h"
#include "llcoord.h"
#include "llwindow.h"
+#include "llemojihelper.h"
#include "llcriticaldamp.h"
#include "lluictrlfactory.h"
@@ -1411,6 +1412,7 @@ void LLMenuItemBranchDownGL::openMenu( void )
}
else
{
+ LLEmojiHelper::instance().hideHelper(nullptr, true);
if (branch->getTornOff())
{
LLFloater * branch_parent = dynamic_cast<LLFloater *>(branch->getParent());
diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h
index 66f84393fe..ff9456acc6 100644
--- a/indra/llui/llmenugl.h
+++ b/indra/llui/llmenugl.h
@@ -439,8 +439,6 @@ protected:
public:
virtual ~LLMenuGL( void );
- void parseChildXML(LLXMLNodePtr child, LLView* parent);
-
// LLView Functionality
/*virtual*/ bool handleUnicodeCharHere( llwchar uni_char );
/*virtual*/ bool handleHover( S32 x, S32 y, MASK mask );
diff --git a/indra/llui/llmodaldialog.cpp b/indra/llui/llmodaldialog.cpp
index c5c31f7252..225ff607ad 100644
--- a/indra/llui/llmodaldialog.cpp
+++ b/indra/llui/llmodaldialog.cpp
@@ -28,6 +28,7 @@
#include "llmodaldialog.h"
+#include "llemojihelper.h"
#include "llfocusmgr.h"
#include "v4color.h"
#include "v2math.h"
@@ -35,6 +36,7 @@
#include "llwindow.h"
#include "llkeyboard.h"
#include "llmenugl.h"
+
// static
std::list<LLModalDialog*> LLModalDialog::sModalStack;
@@ -98,7 +100,7 @@ void LLModalDialog::onOpen(const LLSD& key)
{
if (mModal)
{
- // If Modal, Hide the active modal dialog
+ // If Modal, hide the active modal dialog
if (!sModalStack.empty())
{
LLModalDialog* front = sModalStack.front();
@@ -155,6 +157,12 @@ void LLModalDialog::setVisible( bool visible )
{
if( visible )
{
+ // Hide all menus currently shown
+ LLMenuGL::sMenuContainer->hideMenus();
+
+ // Hide EmojiPicker if it is shown
+ LLEmojiHelper::instance().hideHelper(nullptr, true);
+
// This is a modal dialog. It sucks up all mouse and keyboard operations.
gFocusMgr.setMouseCapture( this );
@@ -301,7 +309,6 @@ void LLModalDialog::centerOnScreen()
centerWithin(LLRect(0, 0, ll_round(window_size.mV[VX]), ll_round(window_size.mV[VY])));
}
-
// static
void LLModalDialog::onAppFocusLost()
{
@@ -333,6 +340,7 @@ void LLModalDialog::onAppFocusGained()
}
}
+// static
void LLModalDialog::shutdownModals()
{
// This method is only for use during app shutdown. ~LLModalDialog()
diff --git a/indra/llui/llmultifloater.cpp b/indra/llui/llmultifloater.cpp
index a7f9b8b2d9..f53e22c349 100644
--- a/indra/llui/llmultifloater.cpp
+++ b/indra/llui/llmultifloater.cpp
@@ -390,7 +390,7 @@ LLFloater* LLMultiFloater::getActiveFloater()
return (LLFloater*)mTabContainer->getCurrentPanel();
}
-S32 LLMultiFloater::getFloaterCount()
+S32 LLMultiFloater::getFloaterCount() const
{
return mTabContainer->getTabCount();
}
diff --git a/indra/llui/llmultifloater.h b/indra/llui/llmultifloater.h
index eb0f917695..e0cd58aa3f 100644
--- a/indra/llui/llmultifloater.h
+++ b/indra/llui/llmultifloater.h
@@ -66,7 +66,7 @@ public:
virtual LLFloater* getActiveFloater();
virtual bool isFloaterFlashing(LLFloater* floaterp);
- virtual S32 getFloaterCount();
+ virtual S32 getFloaterCount() const;
virtual void setFloaterFlashing(LLFloater* floaterp, bool flashing);
virtual bool closeAllFloaters(); //Returns false if the floater could not be closed due to pending confirmation dialogs
diff --git a/indra/llui/llmultislider.h b/indra/llui/llmultislider.h
index b2bfc8bc84..af255bcc8f 100644
--- a/indra/llui/llmultislider.h
+++ b/indra/llui/llmultislider.h
@@ -117,10 +117,10 @@ public:
/*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask) override;
/*virtual*/ void draw() override;
- S32 getMaxNumSliders() { return mMaxNumSliders; }
- S32 getCurNumSliders() { return static_cast<S32>(mValue.size()); }
- F32 getOverlapThreshold() { return mOverlapThreshold; }
- bool canAddSliders() { return mValue.size() < mMaxNumSliders; }
+ S32 getMaxNumSliders() const { return mMaxNumSliders; }
+ S32 getCurNumSliders() const { return static_cast<S32>(mValue.size()); }
+ F32 getOverlapThreshold() const { return mOverlapThreshold; }
+ bool canAddSliders() const { return mValue.size() < mMaxNumSliders; }
protected:
diff --git a/indra/llui/llmultisliderctrl.h b/indra/llui/llmultisliderctrl.h
index dec6cb48b9..2c2bc5e4d9 100644
--- a/indra/llui/llmultisliderctrl.h
+++ b/indra/llui/llmultisliderctrl.h
@@ -124,10 +124,10 @@ public:
F32 getMinValue() const { return mMultiSlider->getMinValue(); }
F32 getMaxValue() const { return mMultiSlider->getMaxValue(); }
- S32 getMaxNumSliders() { return mMultiSlider->getMaxNumSliders(); }
- S32 getCurNumSliders() { return mMultiSlider->getCurNumSliders(); }
- F32 getOverlapThreshold() { return mMultiSlider->getOverlapThreshold(); }
- bool canAddSliders() { return mMultiSlider->canAddSliders(); }
+ S32 getMaxNumSliders() const { return mMultiSlider->getMaxNumSliders(); }
+ S32 getCurNumSliders() const { return mMultiSlider->getCurNumSliders(); }
+ F32 getOverlapThreshold() const { return mMultiSlider->getOverlapThreshold(); }
+ bool canAddSliders() const { return mMultiSlider->canAddSliders(); }
void setLabel(const std::string& label) { if (mLabelBox) mLabelBox->setText(label); }
void setLabelColor(const LLUIColor& c) { mTextEnabledColor = c; }
@@ -147,7 +147,6 @@ public:
static void onEditorCommit(LLUICtrl* ctrl, const LLSD& userdata);
static void onEditorGainFocus(LLFocusableElement* caller, void *userdata);
- static void onEditorChangeFocus(LLUICtrl* caller, S32 direction, void *userdata);
private:
void updateText();
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index 138f1969d5..3c8e1e85fa 100644
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -247,7 +247,6 @@ public:
LLNotificationForm(const LLSD& sd);
LLNotificationForm(const std::string& name, const Params& p);
- void fromLLSD(const LLSD& sd);
LLSD asLLSD() const;
S32 getNumElements() { return static_cast<S32>(mFormData.size()); }
@@ -266,8 +265,8 @@ public:
bool getIgnored();
void setIgnored(bool ignored);
- EIgnoreType getIgnoreType() { return mIgnore; }
- std::string getIgnoreMessage() { return mIgnoreMsg; }
+ EIgnoreType getIgnoreType()const { return mIgnore; }
+ std::string getIgnoreMessage() const { return mIgnoreMsg; }
private:
LLSD mFormData;
@@ -971,8 +970,6 @@ private:
/*virtual*/ void initSingleton() override;
/*virtual*/ void cleanupSingleton() override;
- void loadPersistentNotifications();
-
bool expirationFilter(LLNotificationPtr pNotification);
bool expirationHandler(const LLSD& payload);
bool uniqueFilter(LLNotificationPtr pNotification);
diff --git a/indra/llui/llprogressbar.h b/indra/llui/llprogressbar.h
index 0d5d32cf21..7245bbf1cf 100644
--- a/indra/llui/llprogressbar.h
+++ b/indra/llui/llprogressbar.h
@@ -48,9 +48,9 @@ public:
LLProgressBar(const Params&);
virtual ~LLProgressBar();
- void setValue(const LLSD& value);
+ void setValue(const LLSD& value) override;
- /*virtual*/ void draw();
+ void draw() override;
private:
F32 mPercentDone;
diff --git a/indra/llui/llresizebar.h b/indra/llui/llresizebar.h
index 4b0f435834..68bf0fd95e 100644
--- a/indra/llui/llresizebar.h
+++ b/indra/llui/llresizebar.h
@@ -61,7 +61,7 @@ public:
void setResizeLimits( S32 min_size, S32 max_size ) { mMinSize = min_size; mMaxSize = max_size; }
void setEnableSnapping(bool enable) { mSnappingEnabled = enable; }
void setAllowDoubleClickSnapping(bool allow) { mAllowDoubleClickSnapping = allow; }
- bool canResize() { return getEnabled() && mMaxSize > mMinSize; }
+ bool canResize() const { return getEnabled() && mMaxSize > mMinSize; }
void setResizeListener(boost::function<void(void*)> listener) {mResizeListener = listener;}
void setImagePanel(LLPanel * panelp);
LLPanel * getImagePanel() const;
diff --git a/indra/llui/llresizehandle.h b/indra/llui/llresizehandle.h
index 9cc4123544..caec33405c 100644
--- a/indra/llui/llresizehandle.h
+++ b/indra/llui/llresizehandle.h
@@ -50,10 +50,10 @@ protected:
LLResizeHandle(const LLResizeHandle::Params&);
friend class LLUICtrlFactory;
public:
- virtual void draw();
- virtual bool handleHover(S32 x, S32 y, MASK mask);
- virtual bool handleMouseDown(S32 x, S32 y, MASK mask);
- virtual bool handleMouseUp(S32 x, S32 y, MASK mask);
+ void draw() override;
+ bool handleHover(S32 x, S32 y, MASK mask) override;
+ bool handleMouseDown(S32 x, S32 y, MASK mask) override;
+ bool handleMouseUp(S32 x, S32 y, MASK mask) override;
void setResizeLimits( S32 min_width, S32 min_height ) { mMinWidth = min_width; mMinHeight = min_height; }
@@ -71,8 +71,8 @@ private:
const ECorner mCorner;
};
-const S32 RESIZE_HANDLE_HEIGHT = 11;
-const S32 RESIZE_HANDLE_WIDTH = 11;
+constexpr S32 RESIZE_HANDLE_HEIGHT = 11;
+constexpr S32 RESIZE_HANDLE_WIDTH = 11;
#endif // LL_RESIZEHANDLE_H
diff --git a/indra/llui/llrngwriter.h b/indra/llui/llrngwriter.h
index 33ec049a1a..2c39472607 100644
--- a/indra/llui/llrngwriter.h
+++ b/indra/llui/llrngwriter.h
@@ -37,7 +37,7 @@ public:
void writeRNG(const std::string& name, LLXMLNodePtr node, const LLInitParam::BaseBlock& block, const std::string& xml_namespace);
void addDefinition(const std::string& type_name, const LLInitParam::BaseBlock& block);
- /*virtual*/ std::string getCurrentElementName() { return LLStringUtil::null; }
+ std::string getCurrentElementName() override { return LLStringUtil::null; }
LLRNGWriter();
diff --git a/indra/llui/llscrolllistcell.h b/indra/llui/llscrolllistcell.h
index e7ff5c8424..7dded3c0b7 100644
--- a/indra/llui/llscrolllistcell.h
+++ b/indra/llui/llscrolllistcell.h
@@ -105,7 +105,7 @@ public:
virtual const LLSD getAltValue() const;
virtual void setValue(const LLSD& value) { }
virtual void setAltValue(const LLSD& value) { }
- virtual const std::string &getToolTip() const { return mToolTip; }
+ virtual const std::string& getToolTip() const { return mToolTip; }
virtual void setToolTip(const std::string &str) { mToolTip = str; }
virtual bool getVisible() const { return true; }
virtual void setWidth(S32 width) { mWidth = width; }
diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h
index c24784338a..1f04100306 100644
--- a/indra/llui/llscrolllistctrl.h
+++ b/indra/llui/llscrolllistctrl.h
@@ -165,7 +165,6 @@ public:
void deleteAllItems() { clearRows(); }
// Sets an array of column descriptors
- void setColumnHeadings(const LLSD& headings);
void sortByColumnIndex(U32 column, bool ascending);
// LLCtrlListInterface functions
@@ -318,7 +317,7 @@ public:
void setAllowKeyboardMovement(bool b) { mAllowKeyboardMovement = b; }
void setMaxSelectable(U32 max_selected) { mMaxSelectable = max_selected; }
- S32 getMaxSelectable() { return mMaxSelectable; }
+ S32 getMaxSelectable() const { return mMaxSelectable; }
virtual S32 getScrollPos() const;
@@ -334,7 +333,7 @@ public:
// support right-click context menus for avatar/group lists
enum ContextMenuType { MENU_NONE, MENU_AVATAR, MENU_GROUP };
void setContextMenu(const ContextMenuType &menu) { mContextMenuType = menu; }
- ContextMenuType getContextMenuType() { return mContextMenuType; }
+ ContextMenuType getContextMenuType() const { return mContextMenuType; }
// Overridden from LLView
/*virtual*/ void draw();
@@ -362,7 +361,6 @@ public:
virtual void fitContents(S32 max_width, S32 max_height);
virtual LLRect getRequiredRect();
- static bool rowPreceeds(LLScrollListItem *new_row, LLScrollListItem *test_row);
LLRect getItemListRect() { return mItemListRect; }
@@ -384,7 +382,6 @@ public:
* then display all items.
*/
void setPageLines(S32 page_lines );
- void setCollapseEmptyColumns(bool collapse);
LLScrollListItem* hitItem(S32 x,S32 y);
virtual void scrollToShowSelected();
@@ -401,7 +398,7 @@ public:
void setNumDynamicColumns(S32 num) { mNumDynamicWidthColumns = num; }
void updateStaticColumnWidth(LLScrollListColumn* col, S32 new_width);
- S32 getTotalStaticColumnWidth() { return mTotalStaticColumnWidth; }
+ S32 getTotalStaticColumnWidth() const { return mTotalStaticColumnWidth; }
std::string getSortColumnName();
bool getSortAscending() { return mSortColumns.empty() ? true : mSortColumns.back().second; }
diff --git a/indra/llui/llsliderctrl.h b/indra/llui/llsliderctrl.h
index 311377a61f..23ce8fd955 100644
--- a/indra/llui/llsliderctrl.h
+++ b/indra/llui/llsliderctrl.h
@@ -132,7 +132,6 @@ public:
static void onEditorCommit(LLUICtrl* ctrl, const LLSD& userdata);
static void onEditorGainFocus(LLFocusableElement* caller, void *userdata);
- static void onEditorChangeFocus(LLUICtrl* caller, S32 direction, void *userdata);
protected:
virtual std::string _getSearchText() const
diff --git a/indra/llui/llspinctrl.h b/indra/llui/llspinctrl.h
index 58b38dc630..4ba8c97c63 100644
--- a/indra/llui/llspinctrl.h
+++ b/indra/llui/llspinctrl.h
@@ -94,7 +94,6 @@ public:
void onEditorCommit(const LLSD& data);
static void onEditorGainFocus(LLFocusableElement* caller, void *userdata);
static void onEditorLostFocus(LLFocusableElement* caller, void *userdata);
- static void onEditorChangeFocus(LLUICtrl* caller, S32 direction, void *userdata);
void onUpBtn(const LLSD& data);
void onDownBtn(const LLSD& data);
diff --git a/indra/llui/llstatbar.h b/indra/llui/llstatbar.h
index c36a138566..bbbf0b3a19 100644
--- a/indra/llui/llstatbar.h
+++ b/indra/llui/llstatbar.h
@@ -67,7 +67,7 @@ public:
void setStat(const std::string& stat_name);
void setRange(F32 bar_min, F32 bar_max);
- void getRange(F32& bar_min, F32& bar_max) { bar_min = mTargetMinBar; bar_max = mTargetMaxBar; }
+ void getRange(F32& bar_min, F32& bar_max) const { bar_min = mTargetMinBar; bar_max = mTargetMaxBar; }
/*virtual*/ LLRect getRequiredRect(); // Return the height of this object, given the set options.
diff --git a/indra/llui/llstatgraph.cpp b/indra/llui/llstatgraph.cpp
index d97051247e..0af717d447 100644
--- a/indra/llui/llstatgraph.cpp
+++ b/indra/llui/llstatgraph.cpp
@@ -36,7 +36,6 @@
#include "llglheaders.h"
#include "lltracerecording.h"
#include "lltracethreadrecorder.h"
-//#include "llviewercontrol.h"
///////////////////////////////////////////////////////////////////////////////////
diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h
index c254821870..6d9e3d1064 100644
--- a/indra/llui/llstatgraph.h
+++ b/indra/llui/llstatgraph.h
@@ -99,9 +99,7 @@ public:
void setMin(const F32 min);
void setMax(const F32 max);
- virtual void draw();
-
- /*virtual*/ void setValue(const LLSD& value);
+ void draw() override;
private:
LLTrace::StatType<LLTrace::CountAccumulator>* mNewStatFloatp;
@@ -133,9 +131,6 @@ private:
};
typedef std::vector<Threshold> threshold_vec_t;
threshold_vec_t mThresholds;
- //S32 mNumThresholds;
- //F32 mThresholds[4];
- //LLColor4 mThresholdColors[4];
};
#endif // LL_LLSTATGRAPH_H
diff --git a/indra/llui/llstatview.h b/indra/llui/llstatview.h
index b5187f886d..a396773057 100644
--- a/indra/llui/llstatview.h
+++ b/indra/llui/llstatview.h
@@ -29,7 +29,6 @@
#include "llstatbar.h"
#include "llcontainerview.h"
-#include <vector>
class LLStatBar;
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index 595ab0bd2b..5e0985c79c 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -1370,17 +1370,17 @@ LLPanel* LLTabContainer::getCurrentPanel()
return NULL;
}
-S32 LLTabContainer::getCurrentPanelIndex()
+S32 LLTabContainer::getCurrentPanelIndex() const
{
return mCurrentTabIdx;
}
-S32 LLTabContainer::getTabCount()
+S32 LLTabContainer::getTabCount() const
{
return static_cast<S32>(mTabList.size());
}
-LLPanel* LLTabContainer::getPanelByIndex(S32 index)
+LLPanel* LLTabContainer::getPanelByIndex(S32 index) const
{
if (index >= 0 && index < (S32)mTabList.size())
{
@@ -1389,7 +1389,7 @@ LLPanel* LLTabContainer::getPanelByIndex(S32 index)
return NULL;
}
-S32 LLTabContainer::getIndexForPanel(LLPanel* panel)
+S32 LLTabContainer::getIndexForPanel(LLPanel* panel) const
{
for (S32 index = 0; index < (S32)mTabList.size(); index++)
{
@@ -1401,7 +1401,7 @@ S32 LLTabContainer::getIndexForPanel(LLPanel* panel)
return -1;
}
-S32 LLTabContainer::getPanelIndexByTitle(std::string_view title)
+S32 LLTabContainer::getPanelIndexByTitle(std::string_view title) const
{
for (S32 index = 0 ; index < (S32)mTabList.size(); index++)
{
diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h
index 40f272ffa8..4ac7e73d25 100644
--- a/indra/llui/lltabcontainer.h
+++ b/indra/llui/lltabcontainer.h
@@ -182,15 +182,15 @@ public:
void removeTabPanel( LLPanel* child );
void lockTabs(S32 num_tabs = 0);
void unlockTabs();
- S32 getNumLockedTabs() { return mLockedTabCount; }
+ S32 getNumLockedTabs() const { return mLockedTabCount; }
void enableTabButton(S32 which, bool enable);
void deleteAllTabs();
LLPanel* getCurrentPanel();
- S32 getCurrentPanelIndex();
- S32 getTabCount();
- LLPanel* getPanelByIndex(S32 index);
- S32 getIndexForPanel(LLPanel* panel);
- S32 getPanelIndexByTitle(std::string_view title);
+ S32 getCurrentPanelIndex() const;
+ S32 getTabCount() const;
+ LLPanel* getPanelByIndex(S32 index) const;
+ S32 getIndexForPanel(LLPanel* panel) const;
+ S32 getPanelIndexByTitle(std::string_view title) const;
LLPanel* getPanelByName(std::string_view name);
S32 getTotalTabWidth() const;
void setCurrentTabName(const std::string& name);
diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h
index 76d4e160af..e62b56963d 100644
--- a/indra/llui/lltextbase.h
+++ b/indra/llui/lltextbase.h
@@ -145,7 +145,6 @@ public:
/*virtual*/ void setStyle(LLStyleConstSP style) { mStyle = style; }
/*virtual*/ void setToken( LLKeywordToken* token ) { mToken = token; }
/*virtual*/ LLKeywordToken* getToken() const { return mToken; }
- /*virtual*/ bool getToolTip( std::string& msg ) const;
/*virtual*/ void setToolTip(const std::string& tooltip);
/*virtual*/ void dump() const;
@@ -450,7 +449,7 @@ public:
virtual void setText(const LLStringExplicit &utf8str , const LLStyle::Params& input_params = LLStyle::Params()); // uses default style
/*virtual*/ const std::string& getText() const override;
void setMaxTextLength(S32 length) { mMaxTextByteLength = length; }
- S32 getMaxTextLength() { return mMaxTextByteLength; }
+ S32 getMaxTextLength() const { return mMaxTextByteLength; }
// wide-char versions
void setWText(const LLWString& text);
@@ -489,10 +488,10 @@ public:
LLRect getTextBoundingRect();
LLRect getVisibleDocumentRect() const;
- S32 getVPad() { return mVPad; }
- S32 getHPad() { return mHPad; }
- F32 getLineSpacingMult() { return mLineSpacingMult; }
- S32 getLineSpacingPixels() { return mLineSpacingPixels; } // only for multiline
+ S32 getVPad() const { return mVPad; }
+ S32 getHPad() const { return mHPad; }
+ F32 getLineSpacingMult() const { return mLineSpacingMult; }
+ S32 getLineSpacingPixels() const { return mLineSpacingPixels; } // only for multiline
S32 getDocIndexFromLocalCoord( S32 local_x, S32 local_y, bool round, bool hit_past_end_of_line = true) const;
LLRect getLocalRectFromDocIndex(S32 pos) const;
@@ -502,7 +501,7 @@ public:
bool getReadOnly() const { return mReadOnly; }
void setSkipLinkUnderline(bool skip_link_underline) { mSkipLinkUnderline = skip_link_underline; }
- bool getSkipLinkUnderline() { return mSkipLinkUnderline; }
+ bool getSkipLinkUnderline() const { return mSkipLinkUnderline; }
void setParseURLs(bool parse_urls) { mParseHTML = parse_urls; }
@@ -516,8 +515,8 @@ public:
void endOfLine();
void startOfDoc();
void endOfDoc();
- void changePage( S32 delta );
- void changeLine( S32 delta );
+ void changePage(S32 delta);
+ void changeLine(S32 delta);
bool scrolledToStart();
bool scrolledToEnd();
@@ -675,7 +674,6 @@ protected:
void appendTextImpl(const std::string &new_text, const LLStyle::Params& input_params = LLStyle::Params());
void appendAndHighlightTextImpl(const std::string &new_text, S32 highlight_part, const LLStyle::Params& style_params, bool underline_on_hover_only = false);
- S32 normalizeUri(std::string& uri);
protected:
// virtual
diff --git a/indra/llui/lltextbox.h b/indra/llui/lltextbox.h
index 500dc8669f..507d8f3ee6 100644
--- a/indra/llui/lltextbox.h
+++ b/indra/llui/lltextbox.h
@@ -46,39 +46,39 @@ protected:
friend class LLUICtrlFactory;
public:
- virtual ~LLTextBox();
+ ~LLTextBox() override;
- /*virtual*/ bool handleMouseDown(S32 x, S32 y, MASK mask);
- /*virtual*/ bool handleMouseUp(S32 x, S32 y, MASK mask);
- /*virtual*/ bool handleHover(S32 x, S32 y, MASK mask);
+ bool handleMouseDown(S32 x, S32 y, MASK mask) override;
+ bool handleMouseUp(S32 x, S32 y, MASK mask) override;
+ bool handleHover(S32 x, S32 y, MASK mask) override;
- /*virtual*/ void setEnabled(bool enabled);
+ void setEnabled(bool enabled) override;
- /*virtual*/ void setText( const LLStringExplicit& text, const LLStyle::Params& input_params = LLStyle::Params() );
+ void setText(const LLStringExplicit& text, const LLStyle::Params& input_params = LLStyle::Params()) override;
- void setRightAlign() { mHAlign = LLFontGL::RIGHT; }
- void setHAlign( LLFontGL::HAlign align ) { mHAlign = align; }
- void setClickedCallback( boost::function<void (void*)> cb, void* userdata = NULL );
+ void setRightAlign() { mHAlign = LLFontGL::RIGHT; }
+ void setHAlign(LLFontGL::HAlign align) { mHAlign = align; }
+ void setClickedCallback(boost::function<void(void*)> cb, void* userdata = NULL);
- void reshapeToFitText(bool called_from_parent = false);
+ void reshapeToFitText(bool called_from_parent = false);
- S32 getTextPixelWidth();
- S32 getTextPixelHeight();
+ S32 getTextPixelWidth();
+ S32 getTextPixelHeight();
- /*virtual*/ LLSD getValue() const;
- /*virtual*/ bool setTextArg( const std::string& key, const LLStringExplicit& text );
+ LLSD getValue() const override;
+ bool setTextArg(const std::string& key, const LLStringExplicit& text) override;
- void setShowCursorHand(bool show_cursor) { mShowCursorHand = show_cursor; }
+ void setShowCursorHand(bool show_cursor) { mShowCursorHand = show_cursor; }
protected:
- void onUrlLabelUpdated(const std::string &url, const std::string &label);
+ void onUrlLabelUpdated(const std::string& url, const std::string& label);
LLUIString mText;
callback_t mClickedCallback;
bool mShowCursorHand;
protected:
- virtual std::string _getSearchText() const
+ virtual std::string _getSearchText() const override
{
return LLTextBase::_getSearchText() + mText.getString();
}
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 77a4976f6b..d89e5a9857 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -272,7 +272,9 @@ LLTextEditor::LLTextEditor(const LLTextEditor::Params& p) :
mShowEmojiHelper(p.show_emoji_helper),
mEnableTooltipPaste(p.enable_tooltip_paste),
mPassDelete(false),
- mKeepSelectionOnReturn(false)
+ mKeepSelectionOnReturn(false),
+ mSelectAllOnFocusReceived(false),
+ mSelectedOnFocusReceived(false)
{
mSourceID.generate();
@@ -396,6 +398,7 @@ void LLTextEditor::selectNext(const std::string& search_text_in, bool case_insen
setCursorPos(loc);
mIsSelecting = true;
+ mSelectedOnFocusReceived = false;
mSelectionEnd = mCursorPos;
mSelectionStart = llmin((S32)getLength(), (S32)(mCursorPos + search_text.size()));
}
@@ -675,6 +678,13 @@ bool LLTextEditor::canSelectAll() const
return true;
}
+//virtual
+void LLTextEditor::deselect()
+{
+ LLTextBase::deselect();
+ mSelectedOnFocusReceived = false;
+}
+
// virtual
void LLTextEditor::selectAll()
{
@@ -692,6 +702,11 @@ void LLTextEditor::selectByCursorPosition(S32 prev_cursor_pos, S32 next_cursor_p
endSelection();
}
+void LLTextEditor::setSelectAllOnFocusReceived(bool b)
+{
+ mSelectAllOnFocusReceived = b;
+}
+
void LLTextEditor::insertEmoji(llwchar emoji)
{
LL_INFOS() << "LLTextEditor::insertEmoji(" << wchar_utf8_preview(emoji) << ")" << LL_ENDL;
@@ -769,8 +784,16 @@ bool LLTextEditor::handleMouseDown(S32 x, S32 y, MASK mask)
// Delay cursor flashing
resetCursorBlink();
+ mSelectedOnFocusReceived = false;
if (handled && !gFocusMgr.getMouseCapture())
{
+ if (!mask && mSelectAllOnFocusReceived)
+ {
+ mIsSelecting = false;
+ mSelectionStart = getLength();
+ mSelectionEnd = 0;
+ mSelectedOnFocusReceived = true;
+ }
gFocusMgr.setMouseCapture( this );
}
return handled;
@@ -2134,6 +2157,11 @@ void LLTextEditor::focusLostHelper()
gEditMenuHandler = NULL;
}
+ if (mSelectedOnFocusReceived)
+ {
+ deselect();
+ }
+
if (mCommitOnFocusLost)
{
onCommit();
diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h
index e9e7070414..95ffb41380 100644
--- a/indra/llui/lltexteditor.h
+++ b/indra/llui/lltexteditor.h
@@ -142,8 +142,10 @@ public:
virtual bool canDoDelete() const;
virtual void selectAll();
virtual bool canSelectAll() const;
+ virtual void deselect();
void selectByCursorPosition(S32 prev_cursor_pos, S32 next_cursor_pos);
+ void setSelectAllOnFocusReceived(bool b);
virtual bool canLoadOrSaveToFile();
@@ -200,7 +202,6 @@ public:
const LLUUID& getSourceID() const { return mSourceID; }
const LLTextSegmentPtr getPreviousSegment() const;
- const LLTextSegmentPtr getLastSegment() const;
void getSelectedSegments(segment_vec_t& segments) const;
void setShowContextMenu(bool show) { mShowContextMenu = show; }
@@ -216,8 +217,6 @@ protected:
void showContextMenu(S32 x, S32 y);
void drawPreeditMarker();
- void assignEmbedded(const std::string &s);
-
void removeCharOrTab();
void indentSelectedLines( S32 spaces );
@@ -237,7 +236,6 @@ protected:
void autoIndent();
- void findEmbeddedItemSegments(S32 start, S32 end);
void getSegmentsInRange(segment_vec_t& segments, S32 start, S32 end, bool include_partial) const;
virtual llwchar pasteEmbeddedItem(llwchar ext_char) { return ext_char; }
@@ -304,7 +302,7 @@ private:
// Methods
//
void pasteHelper(bool is_primary);
- void cleanStringForPaste(LLWString & clean_string);
+ void cleanStringForPaste(LLWString& clean_string);
void pasteTextWithLinebreaks(LLWString & clean_string);
void onKeyStroke();
@@ -333,6 +331,8 @@ private:
bool mEnableTooltipPaste;
bool mPassDelete;
bool mKeepSelectionOnReturn; // disabling of removing selected text after pressing of Enter
+ bool mSelectAllOnFocusReceived;
+ bool mSelectedOnFocusReceived;
LLUUID mSourceID;
diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h
index c57c979525..5556406fbd 100644
--- a/indra/llui/lltoolbar.h
+++ b/indra/llui/lltoolbar.h
@@ -68,7 +68,7 @@ public:
void reshape(S32 width, S32 height, bool called_from_parent = true);
void setEnabled(bool enabled);
void setCommandId(const LLCommandId& id) { mId = id; }
- LLCommandId getCommandId() { return mId; }
+ LLCommandId getCommandId() const { return mId; }
void setStartDragCallback(tool_startdrag_callback_t cb) { mStartDragItemCallback = cb; }
void setHandleDragCallback(tool_handledrag_callback_t cb) { mHandleDragItemCallback = cb; }
@@ -256,7 +256,7 @@ public:
// Methods used in loading and saving toolbar settings
void setButtonType(LLToolBarEnums::ButtonType button_type);
- LLToolBarEnums::ButtonType getButtonType() { return mButtonType; }
+ LLToolBarEnums::ButtonType getButtonType() const { return mButtonType; }
command_id_list_t& getCommandsList() { return mButtonCommands; }
void clearCommandsList();
diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp
index 86525c2f7e..74f03618cf 100644
--- a/indra/llui/lltooltip.cpp
+++ b/indra/llui/lltooltip.cpp
@@ -390,22 +390,22 @@ void LLToolTip::draw()
}
}
-bool LLToolTip::isFading()
+bool LLToolTip::isFading() const
{
return mFadeTimer.getStarted();
}
-F32 LLToolTip::getVisibleTime()
+F32 LLToolTip::getVisibleTime() const
{
return mVisibleTimer.getStarted() ? mVisibleTimer.getElapsedTimeF32() : 0.f;
}
-bool LLToolTip::hasClickCallback()
+bool LLToolTip::hasClickCallback() const
{
return mHasClickCallback;
}
-void LLToolTip::getToolTipMessage(std::string & message)
+void LLToolTip::getToolTipMessage(std::string& message) const
{
if (mTextBox)
{
diff --git a/indra/llui/lltooltip.h b/indra/llui/lltooltip.h
index 8515504e3b..760acddd6f 100644
--- a/indra/llui/lltooltip.h
+++ b/indra/llui/lltooltip.h
@@ -44,15 +44,15 @@ public:
Params();
};
LLToolTipView(const LLToolTipView::Params&);
- /*virtual*/ bool handleHover(S32 x, S32 y, MASK mask);
- /*virtual*/ bool handleMouseDown(S32 x, S32 y, MASK mask);
- /*virtual*/ bool handleMiddleMouseDown(S32 x, S32 y, MASK mask);
- /*virtual*/ bool handleRightMouseDown(S32 x, S32 y, MASK mask);
- /*virtual*/ bool handleScrollWheel( S32 x, S32 y, S32 clicks );
+ bool handleHover(S32 x, S32 y, MASK mask) override;
+ bool handleMouseDown(S32 x, S32 y, MASK mask) override;
+ bool handleMiddleMouseDown(S32 x, S32 y, MASK mask) override;
+ bool handleRightMouseDown(S32 x, S32 y, MASK mask) override;
+ bool handleScrollWheel( S32 x, S32 y, S32 clicks ) override;
void drawStickyRect();
- /*virtual*/ void draw();
+ void draw() override;
};
class LLToolTip : public LLPanel
@@ -98,20 +98,20 @@ public:
Params();
};
- /*virtual*/ void draw();
- /*virtual*/ bool handleHover(S32 x, S32 y, MASK mask);
- /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask);
- /*virtual*/ void setVisible(bool visible);
+ void draw() override;
+ bool handleHover(S32 x, S32 y, MASK mask) override;
+ void onMouseLeave(S32 x, S32 y, MASK mask) override;
+ void setVisible(bool visible) override;
- bool isFading();
- F32 getVisibleTime();
- bool hasClickCallback();
+ bool isFading() const;
+ F32 getVisibleTime() const;
+ bool hasClickCallback() const;
LLToolTip(const Params& p);
virtual void initFromParams(const LLToolTip::Params& params);
- void getToolTipMessage(std::string & message);
- bool isTooltipPastable() { return mIsTooltipPastable; }
+ void getToolTipMessage(std::string & message) const;
+ bool isTooltipPastable() const { return mIsTooltipPastable; }
protected:
void updateTextBox();
diff --git a/indra/llui/llui.h b/indra/llui/llui.h
index 9890d3f7ef..b2dcb6dc88 100644
--- a/indra/llui/llui.h
+++ b/indra/llui/llui.h
@@ -154,7 +154,7 @@ public:
sanitizeRange();
}
- S32 clamp(S32 input)
+ S32 clamp(S32 input) const
{
if (input < mMin) return mMin;
if (input > mMax) return mMax;
@@ -168,8 +168,8 @@ public:
sanitizeRange();
}
- S32 getMin() { return mMin; }
- S32 getMax() { return mMax; }
+ S32 getMin() const { return mMin; }
+ S32 getMax() const { return mMax; }
bool operator==(const RangeS32& other) const
{
@@ -223,7 +223,7 @@ public:
mValue = clamp(value);
}
- S32 get()
+ S32 get() const
{
return mValue;
}
@@ -253,7 +253,7 @@ public:
static std::string getLanguage(); // static for lldateutil_test compatibility
//helper functions (should probably move free standing rendering helper functions here)
- LLView* getRootView() { return mRootView; }
+ LLView* getRootView() const { return mRootView; }
void setRootView(LLView* view) { mRootView = view; }
/**
* Walk the LLView tree to resolve a path
@@ -296,7 +296,7 @@ public:
LLControlGroup& getControlControlGroup (std::string_view controlname);
F32 getMouseIdleTime() { return mMouseIdleTimer.getElapsedTimeF32(); }
void resetMouseIdleTimer() { mMouseIdleTimer.reset(); }
- LLWindow* getWindow() { return mWindow; }
+ LLWindow* getWindow() const { return mWindow; }
void addPopup(LLView*);
void removePopup(LLView*);
diff --git a/indra/llui/lluiconstants.h b/indra/llui/lluiconstants.h
index 5fdfd37c6e..a317c66008 100644
--- a/indra/llui/lluiconstants.h
+++ b/indra/llui/lluiconstants.h
@@ -28,23 +28,23 @@
#define LL_LLUICONSTANTS_H
// spacing for small font lines of text, like LLTextBoxes
-const S32 LINE = 16;
+constexpr S32 LINE = 16;
// spacing for larger lines of text
-const S32 LINE_BIG = 24;
+constexpr S32 LINE_BIG = 24;
// default vertical padding
-const S32 VPAD = 4;
+constexpr S32 VPAD = 4;
// default horizontal padding
-const S32 HPAD = 4;
+constexpr S32 HPAD = 4;
// Account History, how far to look into past
-const S32 SUMMARY_INTERVAL = 7; // one week
-const S32 SUMMARY_MAX = 8; //
-const S32 DETAILS_INTERVAL = 1; // one day
-const S32 DETAILS_MAX = 30; // one month
-const S32 TRANSACTIONS_INTERVAL = 1;// one day
-const S32 TRANSACTIONS_MAX = 30; // one month
+constexpr S32 SUMMARY_INTERVAL = 7; // one week
+constexpr S32 SUMMARY_MAX = 8; //
+constexpr S32 DETAILS_INTERVAL = 1; // one day
+constexpr S32 DETAILS_MAX = 30; // one month
+constexpr S32 TRANSACTIONS_INTERVAL = 1;// one day
+constexpr S32 TRANSACTIONS_MAX = 30; // one month
#endif
diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h
index 8cd9950917..bcaf479b0f 100644
--- a/indra/llui/lluictrl.h
+++ b/indra/llui/lluictrl.h
@@ -39,9 +39,9 @@
#include "llviewmodel.h" // *TODO move dependency to .cpp file
#include "llsearchablecontrol.h"
-const bool TAKE_FOCUS_YES = true;
-const bool TAKE_FOCUS_NO = false;
-const S32 DROP_SHADOW_FLOATER = 5;
+constexpr bool TAKE_FOCUS_YES = true;
+constexpr bool TAKE_FOCUS_NO = false;
+constexpr S32 DROP_SHADOW_FLOATER = 5;
class LLUICtrl
: public LLView, public boost::signals2::trackable
diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h
index 75e7e396bc..91221dc7f3 100644
--- a/indra/llui/lluictrlfactory.h
+++ b/indra/llui/lluictrlfactory.h
@@ -184,7 +184,7 @@ fail:
template<class T>
static T* getDefaultWidget(std::string_view name)
{
- typename T::Params widget_params;
+ typename T::Params widget_params{};
widget_params.name = std::string(name);
return create<T>(widget_params);
}
diff --git a/indra/llui/llundo.h b/indra/llui/llundo.h
index dc40702be0..990745e530 100644
--- a/indra/llui/llundo.h
+++ b/indra/llui/llundo.h
@@ -42,7 +42,7 @@ public:
LLUndoAction(): mClusterID(0) {};
virtual ~LLUndoAction(){};
private:
- S32 mClusterID;
+ S32 mClusterID;
};
LLUndoBuffer( LLUndoAction (*create_func()), S32 initial_count );
@@ -51,8 +51,8 @@ public:
LLUndoAction *getNextAction(bool setClusterBegin = true);
bool undoAction();
bool redoAction();
- bool canUndo() { return (mNextAction != mFirstAction); }
- bool canRedo() { return (mNextAction != mLastAction); }
+ bool canUndo() const { return (mNextAction != mFirstAction); }
+ bool canRedo() const { return (mNextAction != mLastAction); }
void flushActions();
diff --git a/indra/llui/llurlaction.h b/indra/llui/llurlaction.h
index 0f54b66299..ac9741a7ad 100644
--- a/indra/llui/llurlaction.h
+++ b/indra/llui/llurlaction.h
@@ -45,8 +45,6 @@
class LLUrlAction
{
public:
- LLUrlAction();
-
/// load a Url in the user's preferred web browser
static void openURL(std::string url);
diff --git a/indra/llui/llurlmatch.h b/indra/llui/llurlmatch.h
index ba822fbda6..887796bb37 100644
--- a/indra/llui/llurlmatch.h
+++ b/indra/llui/llurlmatch.h
@@ -31,7 +31,6 @@
//#include "linden_common.h"
#include <string>
-#include <vector>
#include "llstyle.h"
///
diff --git a/indra/llui/llurlregistry.h b/indra/llui/llurlregistry.h
index 64cfec3960..c22af0dbc4 100644
--- a/indra/llui/llurlregistry.h
+++ b/indra/llui/llurlregistry.h
@@ -34,7 +34,6 @@
#include "llstring.h"
#include <string>
-#include <vector>
class LLKeyBindingToStringHandler;
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index 710ec3d05e..97212a9d2d 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -54,17 +54,17 @@
class LLSD;
-const U32 FOLLOWS_NONE = 0x00;
-const U32 FOLLOWS_LEFT = 0x01;
-const U32 FOLLOWS_RIGHT = 0x02;
-const U32 FOLLOWS_TOP = 0x10;
-const U32 FOLLOWS_BOTTOM = 0x20;
-const U32 FOLLOWS_ALL = 0x33;
+constexpr U32 FOLLOWS_NONE = 0x00;
+constexpr U32 FOLLOWS_LEFT = 0x01;
+constexpr U32 FOLLOWS_RIGHT = 0x02;
+constexpr U32 FOLLOWS_TOP = 0x10;
+constexpr U32 FOLLOWS_BOTTOM = 0x20;
+constexpr U32 FOLLOWS_ALL = 0x33;
-const bool MOUSE_OPAQUE = true;
-const bool NOT_MOUSE_OPAQUE = false;
+constexpr bool MOUSE_OPAQUE = true;
+constexpr bool NOT_MOUSE_OPAQUE = false;
-const U32 GL_NAME_UI_RESERVED = 2;
+constexpr U32 GL_NAME_UI_RESERVED = 2;
// maintains render state during traversal of UI tree
@@ -241,7 +241,7 @@ public:
void setUseBoundingRect( bool use_bounding_rect );
bool getUseBoundingRect() const;
- ECursorType getHoverCursor() { return mHoverCursor; }
+ ECursorType getHoverCursor() const { return mHoverCursor; }
static F32 getTooltipTimeout();
virtual const std::string getToolTip() const;
@@ -265,7 +265,7 @@ public:
void setDefaultTabGroup(S32 d) { mDefaultTabGroup = d; }
S32 getDefaultTabGroup() const { return mDefaultTabGroup; }
- S32 getLastTabGroup() { return mLastTabGroup; }
+ S32 getLastTabGroup() const { return mLastTabGroup; }
bool isInVisibleChain() const;
bool isInEnabledChain() const;
diff --git a/indra/llui/llviewborder.h b/indra/llui/llviewborder.h
index 1f118a0d20..a4bb748b77 100644
--- a/indra/llui/llviewborder.h
+++ b/indra/llui/llviewborder.h
@@ -92,7 +92,6 @@ public:
private:
void drawOnePixelLines();
void drawTwoPixelLines();
- void drawTextures();
EBevel mBevel;
EStyle mStyle;
diff --git a/indra/llui/llviewereventrecorder.h b/indra/llui/llviewereventrecorder.h
index 9e752e8090..5636c068d8 100644
--- a/indra/llui/llviewereventrecorder.h
+++ b/indra/llui/llviewereventrecorder.h
@@ -61,7 +61,7 @@ public:
std::string get_xui();
void update_xui(std::string xui);
- bool getLoggingStatus(){return logEvents;};
+ bool getLoggingStatus() const { return logEvents; }
void setEventLoggingOn();
void setEventLoggingOff();
diff --git a/indra/llui/llvirtualtrackball.h b/indra/llui/llvirtualtrackball.h
index 61a78b2398..fbfda04585 100644
--- a/indra/llui/llvirtualtrackball.h
+++ b/indra/llui/llvirtualtrackball.h
@@ -78,20 +78,20 @@ public:
};
- virtual ~LLVirtualTrackball();
- /*virtual*/ bool postBuild();
+ ~LLVirtualTrackball() override;
+ bool postBuild() override;
- virtual bool handleHover(S32 x, S32 y, MASK mask);
- virtual bool handleMouseUp(S32 x, S32 y, MASK mask);
- virtual bool handleMouseDown(S32 x, S32 y, MASK mask);
- virtual bool handleRightMouseDown(S32 x, S32 y, MASK mask);
- virtual bool handleKeyHere(KEY key, MASK mask);
+ bool handleHover(S32 x, S32 y, MASK mask) override;
+ bool handleMouseUp(S32 x, S32 y, MASK mask) override;
+ bool handleMouseDown(S32 x, S32 y, MASK mask) override;
+ bool handleRightMouseDown(S32 x, S32 y, MASK mask) override;
+ bool handleKeyHere(KEY key, MASK mask) override;
- virtual void draw();
+ void draw() override;
- virtual void setValue(const LLSD& value);
- void setValue(F32 x, F32 y, F32 z, F32 w);
- virtual LLSD getValue() const;
+ void setValue(const LLSD& value) override;
+ void setValue(F32 x, F32 y, F32 z, F32 w);
+ LLSD getValue() const override;
void setRotation(const LLQuaternion &value);
LLQuaternion getRotation() const;
@@ -102,7 +102,6 @@ public:
protected:
friend class LLUICtrlFactory;
LLVirtualTrackball(const Params&);
- void onEditChange();
protected:
LLTextBox* mNLabel;
diff --git a/indra/llui/llwindowshade.h b/indra/llui/llwindowshade.h
index da29188943..ee230cd2f6 100644
--- a/indra/llui/llwindowshade.h
+++ b/indra/llui/llwindowshade.h
@@ -49,7 +49,7 @@ public:
};
void show(LLNotificationPtr);
- /*virtual*/ void draw();
+ void draw() override;
void hide();
bool isShown() const;
diff --git a/indra/llui/llxyvector.h b/indra/llui/llxyvector.h
index bc41213c13..646771f387 100644
--- a/indra/llui/llxyvector.h
+++ b/indra/llui/llxyvector.h
@@ -65,18 +65,18 @@ public:
};
- virtual ~LLXYVector();
- /*virtual*/ bool postBuild();
+ ~LLXYVector() override;
+ bool postBuild() override;
- virtual bool handleHover(S32 x, S32 y, MASK mask);
- virtual bool handleMouseUp(S32 x, S32 y, MASK mask);
- virtual bool handleMouseDown(S32 x, S32 y, MASK mask);
+ bool handleHover(S32 x, S32 y, MASK mask) override;
+ bool handleMouseUp(S32 x, S32 y, MASK mask) override;
+ bool handleMouseDown(S32 x, S32 y, MASK mask) override;
- virtual void draw();
+ void draw() override;
- virtual void setValue(const LLSD& value);
- void setValue(F32 x, F32 y);
- virtual LLSD getValue() const;
+ void setValue(const LLSD& value) override;
+ void setValue(F32 x, F32 y);
+ LLSD getValue() const override;
protected:
friend class LLUICtrlFactory;
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 730e658c6a..249aebb335 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -339,10 +339,14 @@ struct LLWindowWin32::LLWindowWin32Thread : public LL::ThreadPool
LLWindowWin32Thread();
void run() override;
- void close() override;
- // closes queue, wakes thread, waits until thread closes
- void wakeAndDestroy();
+ // Detroys handles and window
+ // Either post to or call from window thread
+ void destroyWindow();
+
+ // Closes queue, wakes thread, waits until thread closes.
+ // Call from main thread
+ bool wakeAndDestroy();
void glReady()
{
@@ -399,6 +403,7 @@ struct LLWindowWin32::LLWindowWin32Thread : public LL::ThreadPool
// until after some graphics setup. See SL-20177. -Cosmic,2023-09-18
bool mGLReady = false;
bool mGotGLBuffer = false;
+ LLAtomicBool mDeleteOnExit = false;
};
@@ -842,6 +847,7 @@ LLWindowWin32::~LLWindowWin32()
}
delete mDragDrop;
+ mDragDrop = NULL;
delete [] mWindowTitle;
mWindowTitle = NULL;
@@ -853,6 +859,7 @@ LLWindowWin32::~LLWindowWin32()
mWindowClassName = NULL;
delete mWindowThread;
+ mWindowThread = NULL;
}
void LLWindowWin32::show()
@@ -971,7 +978,11 @@ void LLWindowWin32::close()
mhDC = NULL;
mWindowHandle = NULL;
- mWindowThread->wakeAndDestroy();
+ if (mWindowThread->wakeAndDestroy())
+ {
+ // thread will delete itselfs once done
+ mWindowThread = NULL;
+ }
}
bool LLWindowWin32::isValid()
@@ -3093,10 +3104,14 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
break;
}
}
- else
+ else // (NULL == window_imp)
{
- // (NULL == window_imp)
LL_DEBUGS("Window") << "No window implementation to handle message with, message code: " << U32(u_msg) << LL_ENDL;
+ if (u_msg == WM_DESTROY)
+ {
+ PostQuitMessage(0); // Posts WM_QUIT with an exit code of 0
+ return 0;
+ }
}
// pass unhandled messages down to Windows
@@ -4568,25 +4583,11 @@ std::vector<std::string> LLWindowWin32::getDynamicFallbackFontList()
#endif // LL_WINDOWS
inline LLWindowWin32::LLWindowWin32Thread::LLWindowWin32Thread()
- : LL::ThreadPool("Window Thread", 1, MAX_QUEUE_SIZE, true /*should be false, temporary workaround for SL-18721*/)
+ : LL::ThreadPool("Window Thread", 1, MAX_QUEUE_SIZE, false)
{
LL::ThreadPool::start();
}
-void LLWindowWin32::LLWindowWin32Thread::close()
-{
- if (!mQueue->isClosed())
- {
- LL_WARNS() << "Closing window thread without using destroy_window_handler" << LL_ENDL;
- LL::ThreadPool::close();
-
- // Workaround for SL-18721 in case window closes too early and abruptly
- LLSplashScreen::show();
- LLSplashScreen::update("..."); // will be updated later
- }
-}
-
-
/**
* LogChange is to log changes in status while trying to avoid spamming the
* log with repeated messages, especially in a tight loop. It refuses to log
@@ -4801,108 +4802,105 @@ void LLWindowWin32::LLWindowWin32Thread::run()
}
#endif
}
+
+ destroyWindow();
+
+ if (mDeleteOnExit)
+ {
+ delete this;
+ }
+}
+
+void LLWindowWin32::LLWindowWin32Thread::destroyWindow()
+{
+ if (mWindowHandleThrd != NULL && IsWindow(mWindowHandleThrd))
+ {
+ if (mhDCThrd)
+ {
+ if (!ReleaseDC(mWindowHandleThrd, mhDCThrd))
+ {
+ LL_WARNS("Window") << "Release of ghDC failed!" << LL_ENDL;
+ }
+ mhDCThrd = NULL;
+ }
+
+ // This causes WM_DESTROY to be sent *immediately*
+ if (!destroy_window_handler(mWindowHandleThrd))
+ {
+ LL_WARNS("Window") << "Failed to destroy Window! " << std::hex << GetLastError() << LL_ENDL;
+ }
+ }
+ else
+ {
+ // Something killed the window while we were busy destroying gl or handle somehow got broken
+ LL_WARNS("Window") << "Failed to destroy Window, invalid handle!" << LL_ENDL;
+ }
+ mWindowHandleThrd = NULL;
+ mhDCThrd = NULL;
}
-void LLWindowWin32::LLWindowWin32Thread::wakeAndDestroy()
+bool LLWindowWin32::LLWindowWin32Thread::wakeAndDestroy()
{
if (mQueue->isClosed())
{
LL_WARNS() << "Tried to close Queue. Win32 thread Queue already closed." << LL_ENDL;
- return;
+ return false;
+ }
+
+ // Hide the window immediately to prevent user interaction during shutdown
+ if (mWindowHandleThrd)
+ {
+ ShowWindow(mWindowHandleThrd, SW_HIDE);
}
- // Make sure we don't leave a blank toolbar button.
- // Also hiding window now prevents user from suspending it
- // via some action (like dragging it around)
- ShowWindow(mWindowHandleThrd, SW_HIDE);
+ mGLReady = false;
- // Schedule destruction
+ // Capture current handle before we lose it
HWND old_handle = mWindowHandleThrd;
- post([this]()
- {
- if (IsWindow(mWindowHandleThrd))
- {
- if (mhDCThrd)
- {
- if (!ReleaseDC(mWindowHandleThrd, mhDCThrd))
- {
- LL_WARNS("Window") << "Release of ghDC failed!" << LL_ENDL;
- }
- mhDCThrd = NULL;
- }
-
- // This causes WM_DESTROY to be sent *immediately*
- if (!destroy_window_handler(mWindowHandleThrd))
- {
- LL_WARNS("Window") << "Failed to destroy Window! " << std::hex << GetLastError() << LL_ENDL;
- }
- }
- else
- {
- // Something killed the window while we were busy destroying gl or handle somehow got broken
- LL_WARNS("Window") << "Failed to destroy Window, invalid handle!" << LL_ENDL;
- }
- mWindowHandleThrd = NULL;
- mhDCThrd = NULL;
- mGLReady = false;
- });
+ // Clear the user data to prevent callbacks from finding us
+ if (old_handle)
+ {
+ SetWindowLongPtr(old_handle, GWLP_USERDATA, NULL);
+ }
+
+ // Signal thread to clean up when done
+ mDeleteOnExit = true;
+
+ // Close the queue first
LL_DEBUGS("Window") << "Closing window's pool queue" << LL_ENDL;
mQueue->close();
- // Post a nonsense user message to wake up the thread in
- // case it is waiting for a getMessage()
+ // Wake up the thread if it's stuck in GetMessage()
if (old_handle)
{
WPARAM wparam{ 0xB0B0 };
LL_DEBUGS("Window") << "PostMessage(" << std::hex << old_handle
<< ", " << WM_DUMMY_
<< ", " << wparam << ")" << std::dec << LL_ENDL;
- PostMessage(old_handle, WM_DUMMY_, wparam, 0x1337);
- }
- // There are cases where window will refuse to close,
- // can't wait forever on join, check state instead
- LLTimer timeout;
- timeout.setTimerExpirySec(2.0);
- while (!getQueue().done() && !timeout.hasExpired() && mWindowHandleThrd)
- {
- ms_sleep(100);
+ // Use PostMessage to signal thread to wake up
+ PostMessage(old_handle, WM_DUMMY_, wparam, 0x1337);
}
- if (getQueue().done() || mWindowHandleThrd == NULL)
+ // Cleanly detach threads instead of joining them to avoid blocking the main thread
+ // This is acceptable since the thread will self-delete with mDeleteOnExit
+ for (auto& pair : mThreads)
{
- // Window is closed, started closing or is cleaning up
- // now wait for our single thread to die.
- if (mWindowHandleThrd)
- {
- LL_INFOS("Window") << "Window is closing, waiting on pool's thread to join, time since post: " << timeout.getElapsedSeconds() << "s" << LL_ENDL;
+ try {
+ // Only detach if the thread is joinable
+ if (pair.second.joinable())
+ {
+ pair.second.detach();
+ }
}
- else
- {
- LL_DEBUGS("Window") << "Waiting on pool's thread, time since post: " << timeout.getElapsedSeconds() << "s" << LL_ENDL;
- }
- for (auto& pair : mThreads)
- {
- pair.second.join();
+ catch (const std::system_error& e) {
+ LL_WARNS("Window") << "Exception detaching thread: " << e.what() << LL_ENDL;
}
}
- else
- {
- // Something suspended window thread, can't afford to wait forever
- // so kill thread instead
- // Ex: This can happen if user starts dragging window arround (if it
- // was visible) or a modal notification pops up
- LL_WARNS("Window") << "Window is frozen, couldn't perform clean exit" << LL_ENDL;
- for (auto& pair : mThreads)
- {
- // very unsafe
- TerminateThread(pair.second.native_handle(), 0);
- pair.second.detach();
- }
- }
LL_DEBUGS("Window") << "thread pool shutdown complete" << LL_ENDL;
+ return true;
}
void LLWindowWin32::post(const std::function<void()>& func)
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 8d7f37142f..681b7a050e 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -349,6 +349,7 @@ set(viewer_SOURCE_FILES
llhudeffectpointat.cpp
llhudeffecttrail.cpp
llhudeffectblob.cpp
+ llhudeffectresetskeleton.cpp
llhudicon.cpp
llhudmanager.cpp
llhudnametag.cpp
@@ -1026,6 +1027,7 @@ set(viewer_HEADER_FILES
llhudeffectpointat.h
llhudeffecttrail.h
llhudeffectblob.h
+ llhudeffectresetskeleton.h
llhudicon.h
llhudmanager.h
llhudnametag.h
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index f8487c020e..e39afd4715 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -113,7 +113,7 @@
<key>Type</key>
<string>S32</string>
<key>Value</key>
- <real>300.0</real>
+ <real>300</real>
</map>
<key>AckCollectTime</key>
<map>
@@ -1875,6 +1875,17 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>DebugSelectionLODs</key>
+ <map>
+ <key>Comment</key>
+ <string>Force selection to show specific LOD, -1 for off, 0 - lowest, 4 - high.</string>
+ <key>Persist</key>
+ <integer>0</integer>
+ <key>Type</key>
+ <string>S32</string>
+ <key>Value</key>
+ <integer>-1</integer>
+ </map>
<key>AnimatedObjectsAllowLeftClick</key>
<map>
<key>Comment</key>
@@ -14579,10 +14590,32 @@
<key>Value</key>
<integer>1</integer>
</map>
- <key>OutfitGallerySortByName</key>
+ <key>OutfitGallerySortOrder</key>
+ <map>
+ <key>Comment</key>
+ <string>Gallery sorting: 0 - sort outfits by name, 1 - images frst, 2 - favorites first</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>S32</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>OutfitListSortOrder</key>
+ <map>
+ <key>Comment</key>
+ <string>How outfit list in Avatar's floater is sorted. 0 - by name 1 - favorites to top</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>S32</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>OutfitListFilterFullList</key>
<map>
<key>Comment</key>
- <string>Always sort outfits by name in Outfit Gallery</string>
+ <string> 0 - show only matches. 1 - show all items in outfit as long as outfit or item inside matches.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@@ -16463,6 +16496,50 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>InventoryFavoritesUseStar</key>
+ <map>
+ <key>Comment</key>
+ <string>Show star near favorited items in inventory</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+ <key>InventoryFavoritesUseHollowStar</key>
+ <map>
+ <key>Comment</key>
+ <string>Show star near folders that contain favorites</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+ <key>InventoryFavoritesColorText</key>
+ <map>
+ <key>Comment</key>
+ <string>render favorite items using InventoryFavoriteText as color</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>1</integer>
+ </map>
+ <key>InventoryAddAttachmentBehavior</key>
+ <map>
+ <key>Comment</key>
+ <string>Defines behavior when hitting return on an inventory item</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>StatsReportMaxDuration</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml
index 80a4bec57f..8361a50b6c 100644
--- a/indra/newview/app_settings/settings_per_account.xml
+++ b/indra/newview/app_settings/settings_per_account.xml
@@ -329,7 +329,7 @@
<key>KeepConversationLogTranscripts</key>
<map>
<key>Comment</key>
- <string>Keep a conversation log and transcripts</string>
+ <string>Keep a conversation log and transcripts 2 - both, 1 - logs, 0 - none</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
diff --git a/indra/newview/app_settings/shaders/class1/deferred/tonemapUtilF.glsl b/indra/newview/app_settings/shaders/class1/deferred/tonemapUtilF.glsl
index a63b8d7c2b..774ccb6baf 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/tonemapUtilF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/tonemapUtilF.glsl
@@ -117,27 +117,34 @@ uniform float exposure;
uniform float tonemap_mix;
uniform int tonemap_type;
+
vec3 toneMap(vec3 color)
{
#ifndef NO_POST
- float exp_scale = texture(exposureMap, vec2(0.5,0.5)).r;
-
- color *= exposure * exp_scale;
+ vec3 linear_input_color = color;
- vec3 clamped_color = clamp(color.rgb, vec3(0.0), vec3(1.0));
+ float exp_scale = texture(exposureMap, vec2(0.5,0.5)).r;
+ float final_exposure = exposure * exp_scale;
+ vec3 exposed_color = color * final_exposure;
+ vec3 tonemapped_color = exposed_color;
switch(tonemap_type)
{
case 0:
- color = PBRNeutralToneMapping(color);
+ tonemapped_color = PBRNeutralToneMapping(exposed_color);
break;
case 1:
- color = toneMapACES_Hill(color);
+ tonemapped_color = toneMapACES_Hill(exposed_color);
break;
}
- // mix tonemapped and linear here to provide adjustment
- color = mix(clamped_color, color, tonemap_mix);
+ vec3 exposed_linear_input = linear_input_color * final_exposure;
+ color = mix(exposed_linear_input, tonemapped_color, tonemap_mix);
+
+ color = clamp(color, 0.0, 1.0);
+#else
+ color *= exposure * texture(exposureMap, vec2(0.5,0.5)).r;
+ color = clamp(color, 0.0, 1.0);
#endif
return color;
@@ -147,20 +154,24 @@ vec3 toneMap(vec3 color)
vec3 toneMapNoExposure(vec3 color)
{
#ifndef NO_POST
- vec3 clamped_color = clamp(color.rgb, vec3(0.0), vec3(1.0));
+ vec3 linear_input_color = color;
+ vec3 tonemapped_color = color;
switch(tonemap_type)
{
case 0:
- color = PBRNeutralToneMapping(color);
+ tonemapped_color = PBRNeutralToneMapping(color);
break;
case 1:
- color = toneMapACES_Hill(color);
+ tonemapped_color = toneMapACES_Hill(color);
break;
}
- // mix tonemapped and linear here to provide adjustment
- color = mix(clamped_color, color, tonemap_mix);
+ color = mix(linear_input_color, tonemapped_color, tonemap_mix);
+
+ color = clamp(color, 0.0, 1.0);
+#else
+ color = clamp(color, 0.0, 1.0);
#endif
return color;
diff --git a/indra/newview/gltfscenemanager.cpp b/indra/newview/gltfscenemanager.cpp
index bf3fada3bd..a38ede592b 100644
--- a/indra/newview/gltfscenemanager.cpp
+++ b/indra/newview/gltfscenemanager.cpp
@@ -220,6 +220,7 @@ void GLTFSceneManager::uploadSelection()
LLFloaterPerms::getGroupPerms("Uploads"),
LLFloaterPerms::getEveryonePerms("Uploads"),
expected_upload_cost,
+ LLUUID::null,
false,
finish,
failure));
@@ -283,6 +284,7 @@ void GLTFSceneManager::uploadSelection()
LLFloaterPerms::getGroupPerms("Uploads"),
LLFloaterPerms::getEveryonePerms("Uploads"),
expected_upload_cost,
+ LLUUID::null,
false,
finish,
failure));
@@ -559,6 +561,7 @@ void GLTFSceneManager::update()
LLFloaterPerms::getGroupPerms("Uploads"),
LLFloaterPerms::getEveryonePerms("Uploads"),
expected_upload_cost,
+ LLUUID::null,
false,
finish,
failure));
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 2161dbe19e..085155714a 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -121,8 +121,8 @@ const F32 MIN_FIDGET_TIME = 8.f; // seconds
const F32 MAX_FIDGET_TIME = 20.f; // seconds
const S32 UI_FEATURE_VERSION = 1;
-// For version 1: 1 - inventory, 2 - gltf
-const S32 UI_FEATURE_FLAGS = 3;
+// For version 1, flag holds: 1 - inventory thumbnails, 2 - gltf, 4 - inventory favorites
+const S32 UI_FEATURE_FLAGS = 7;
// The agent instance.
LLAgent gAgent;
@@ -223,7 +223,6 @@ private:
LLVector3d mPosGlobal;
};
-
class LLTeleportRequestViaLocationLookAt : public LLTeleportRequestViaLocation
{
public:
@@ -604,7 +603,7 @@ void LLAgent::getFeatureVersionAndFlags(S32& version, S32& flags)
if (feature_version.isInteger())
{
version = feature_version.asInteger();
- flags = 1; // inventory flag
+ flags = 3; // show 'favorites' notification
}
else if (feature_version.isMap())
{
@@ -630,13 +629,8 @@ void LLAgent::showLatestFeatureNotification(const std::string key)
if (key == "inventory")
{
- // Notify user about new thumbnail support
- flag = 1;
- }
-
- if (key == "gltf")
- {
- flag = 2;
+ // Notify user about new favorites support
+ flag = 4;
}
if ((flags & flag) == 0)
@@ -843,7 +837,6 @@ void LLAgent::movePitch(F32 mag)
}
}
-
// Does this parcel allow you to fly?
bool LLAgent::canFly()
{
@@ -923,7 +916,6 @@ void LLAgent::setFlying(bool fly, bool fail_sound)
LLFloaterMove::setFlyingMode(fly);
}
-
// UI based mechanism of setting fly state
//-----------------------------------------------------------------------------
// toggleFlying()
@@ -1002,7 +994,6 @@ void LLAgent::capabilityReceivedCallback(const LLUUID &region_id, LLViewerRegion
}
}
-
//-----------------------------------------------------------------------------
// setRegion()
//-----------------------------------------------------------------------------
@@ -1108,7 +1099,6 @@ void LLAgent::setRegion(LLViewerRegion *regionp)
mRegionChangedSignal();
}
-
//-----------------------------------------------------------------------------
// getRegion()
//-----------------------------------------------------------------------------
@@ -1117,7 +1107,6 @@ LLViewerRegion *LLAgent::getRegion() const
return mRegionp;
}
-
LLHost LLAgent::getRegionHost() const
{
if (mRegionp)
@@ -1148,7 +1137,6 @@ bool LLAgent::inPrelude()
return mRegionp && mRegionp->isPrelude();
}
-
std::string LLAgent::getRegionCapability(const std::string &name)
{
if (!mRegionp)
@@ -1157,7 +1145,6 @@ std::string LLAgent::getRegionCapability(const std::string &name)
return mRegionp->getCapability(name);
}
-
//-----------------------------------------------------------------------------
// canManageEstate()
//-----------------------------------------------------------------------------
@@ -1185,7 +1172,6 @@ void LLAgent::sendMessage()
gMessageSystem->sendMessage(mRegionp->getHost());
}
-
//-----------------------------------------------------------------------------
// sendReliableMessage()
//-----------------------------------------------------------------------------
@@ -1219,7 +1205,6 @@ LLVector3 LLAgent::getVelocity() const
}
}
-
//-----------------------------------------------------------------------------
// setPositionAgent()
//-----------------------------------------------------------------------------
@@ -1293,7 +1278,6 @@ const LLVector3 &LLAgent::getPositionAgent()
}
}
-
return mFrameAgent.getOrigin();
}
@@ -1302,7 +1286,6 @@ boost::signals2::connection LLAgent::whenPositionChanged(position_signal_t::slot
return mOnPositionChanged.connect(fn);
}
-
//-----------------------------------------------------------------------------
// getRegionsVisited()
//-----------------------------------------------------------------------------
@@ -1319,7 +1302,6 @@ F64 LLAgent::getDistanceTraveled() const
return mDistanceTraveled;
}
-
//-----------------------------------------------------------------------------
// getPosAgentFromGlobal()
//-----------------------------------------------------------------------------
@@ -1330,7 +1312,6 @@ LLVector3 LLAgent::getPosAgentFromGlobal(const LLVector3d &pos_global) const
return pos_agent;
}
-
//-----------------------------------------------------------------------------
// getPosGlobalFromAgent()
//-----------------------------------------------------------------------------
@@ -1346,7 +1327,6 @@ void LLAgent::sitDown()
setControlFlags(AGENT_CONTROL_SIT_ON_GROUND);
}
-
//-----------------------------------------------------------------------------
// resetAxes()
//-----------------------------------------------------------------------------
@@ -1355,7 +1335,6 @@ void LLAgent::resetAxes()
mFrameAgent.resetAxes();
}
-
// Copied from LLCamera::setOriginAndLookAt
// Look_at must be unit vector
//-----------------------------------------------------------------------------
@@ -1384,7 +1363,6 @@ void LLAgent::resetAxes(const LLVector3 &look_at)
mFrameAgent.setAxes(look_at, left, up);
}
-
//-----------------------------------------------------------------------------
// rotate()
//-----------------------------------------------------------------------------
@@ -1393,7 +1371,6 @@ void LLAgent::rotate(F32 angle, const LLVector3 &axis)
mFrameAgent.rotate(angle, axis);
}
-
//-----------------------------------------------------------------------------
// rotate()
//-----------------------------------------------------------------------------
@@ -1402,7 +1379,6 @@ void LLAgent::rotate(F32 angle, F32 x, F32 y, F32 z)
mFrameAgent.rotate(angle, x, y, z);
}
-
//-----------------------------------------------------------------------------
// rotate()
//-----------------------------------------------------------------------------
@@ -1411,7 +1387,6 @@ void LLAgent::rotate(const LLMatrix3 &matrix)
mFrameAgent.rotate(matrix);
}
-
//-----------------------------------------------------------------------------
// rotate()
//-----------------------------------------------------------------------------
@@ -1420,7 +1395,6 @@ void LLAgent::rotate(const LLQuaternion &quaternion)
mFrameAgent.rotate(quaternion);
}
-
//-----------------------------------------------------------------------------
// getReferenceUpVector()
//-----------------------------------------------------------------------------
@@ -1449,7 +1423,6 @@ LLVector3 LLAgent::getReferenceUpVector()
return up_vector;
}
-
// Radians, positive is forward into ground
//-----------------------------------------------------------------------------
// pitch()
@@ -1493,7 +1466,6 @@ void LLAgent::pitch(F32 angle)
}
}
-
//-----------------------------------------------------------------------------
// roll()
//-----------------------------------------------------------------------------
@@ -1502,7 +1474,6 @@ void LLAgent::roll(F32 angle)
mFrameAgent.roll(angle);
}
-
//-----------------------------------------------------------------------------
// yaw()
//-----------------------------------------------------------------------------
@@ -1514,7 +1485,6 @@ void LLAgent::yaw(F32 angle)
}
}
-
// Returns a quat that represents the rotation of the agent in the absolute frame
//-----------------------------------------------------------------------------
// getQuat()
@@ -1540,7 +1510,6 @@ void LLAgent::setControlFlags(U32 mask)
mControlFlags |= mask;
}
-
//-----------------------------------------------------------------------------
// clearControlFlags()
//-----------------------------------------------------------------------------
@@ -1628,7 +1597,6 @@ bool LLAgent::isDoNotDisturb() const
return mIsDoNotDisturb;
}
-
//-----------------------------------------------------------------------------
// startAutoPilotGlobal()
//-----------------------------------------------------------------------------
@@ -1734,7 +1702,6 @@ void LLAgent::startAutoPilotGlobal(
mAutoPilotNoProgressFrameCount = 0;
}
-
//-----------------------------------------------------------------------------
// setAutoPilotTargetGlobal
//-----------------------------------------------------------------------------
@@ -1788,7 +1755,6 @@ void LLAgent::startFollowPilot(const LLUUID &leader_id, bool allow_flying, F32 s
allow_flying);
}
-
//-----------------------------------------------------------------------------
// stopAutoPilot()
//-----------------------------------------------------------------------------
@@ -1830,7 +1796,6 @@ void LLAgent::stopAutoPilot(bool user_cancel)
}
}
-
// Returns necessary agent pitch and yaw changes, radians.
//-----------------------------------------------------------------------------
// autoPilot()
@@ -2019,7 +1984,6 @@ void LLAgent::autoPilot(F32 *delta_yaw)
}
}
-
//-----------------------------------------------------------------------------
// propagate()
//-----------------------------------------------------------------------------
@@ -2040,18 +2004,19 @@ void LLAgent::propagate(const F32 dt)
}
// handle rotation based on keyboard levels
- constexpr F32 YAW_RATE = 90.f * DEG_TO_RAD; // radians per second
- F32 angle = YAW_RATE * gAgentCamera.getYawKey() * dt;
- if (fabs(angle) > 0.0f)
+ if (fabs(dt) > 1e-6)
{
- yaw(angle);
- }
+ if (fabs(gAgentCamera.getYawKey()) > 1e-6)
+ {
+ static const F32 YAW_RATE = 90.f * DEG_TO_RAD; // radians per second
+ yaw(YAW_RATE * gAgentCamera.getYawKey() * dt);
+ }
- constexpr F32 PITCH_RATE = 90.f * DEG_TO_RAD; // radians per second
- angle = PITCH_RATE * gAgentCamera.getPitchKey() * dt;
- if (fabs(angle) > 0.0f)
- {
- pitch(angle);
+ if (fabs(gAgentCamera.getPitchKey()) > 1e-6)
+ {
+ static const F32 PITCH_RATE = 90.f * DEG_TO_RAD; // radians per second
+ pitch(PITCH_RATE * gAgentCamera.getPitchKey() * dt);
+ }
}
// handle auto-land behavior
@@ -2213,7 +2178,6 @@ void LLAgent::clearRenderState(U8 clearstate)
mRenderState &= ~clearstate;
}
-
//-----------------------------------------------------------------------------
// getRenderState()
//-----------------------------------------------------------------------------
@@ -2255,6 +2219,7 @@ void LLAgent::endAnimationUpdateUI()
{
return;
}
+
if (gAgentCamera.getCameraMode() == gAgentCamera.getLastCameraMode())
{
// We're already done endAnimationUpdateUI for this transition.
@@ -2320,7 +2285,6 @@ void LLAgent::endAnimationUpdateUI()
mViewsPushed = false;
}
-
gAgentCamera.setLookAt(LOOKAT_TARGET_CLEAR);
if( gMorphView )
{
@@ -2952,7 +2916,6 @@ void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity)
}
}
-
void LLAgent::processMaturityPreferenceFromServer(const LLSD &result, U8 perferredMaturity)
{
U8 maturity = SIM_ACCESS_MIN;
@@ -3022,7 +2985,6 @@ void LLAgent::changeInterestListMode(const std::string &new_mode)
}
}
-
bool LLAgent::requestPostCapability(const std::string &capName, LLSD &postData, httpCallback_t cbSuccess, httpCallback_t cbFailure)
{
if (getRegion())
@@ -3349,7 +3311,6 @@ void LLAgent::sendAnimationStateReset()
sendReliableMessage();
}
-
// Send a message to the region to revoke sepecified permissions on ALL scripts in the region
// If the target is an object in the region, permissions in scripts on that object are cleared.
// If it is the region ID, all scripts clear the permissions for this agent
@@ -4279,7 +4240,6 @@ void LLAgent::onCapabilitiesReceivedAfterTeleport()
check_merchant_status();
}
-
void LLAgent::teleportRequest(
const U64& region_handle,
const LLVector3& pos_local,
@@ -4393,7 +4353,6 @@ void LLAgent::doTeleportViaLure(const LLUUID& lure_id, bool godlike)
}
}
-
// James Cook, July 28, 2005
void LLAgent::teleportCancel()
{
@@ -4518,7 +4477,6 @@ LLAgent::ETeleportState LLAgent::getTeleportState() const
TELEPORT_NONE : mTeleportState;
}
-
void LLAgent::setTeleportState(ETeleportState state)
{
if (mTeleportRequest && (state != TELEPORT_NONE) && (mTeleportRequest->getStatus() == LLTeleportRequest::kFailed))
@@ -4563,7 +4521,6 @@ void LLAgent::setTeleportState(ETeleportState state)
}
}
-
void LLAgent::stopCurrentAnimations()
{
LL_DEBUGS("Avatar") << "Stopping current animations" << LL_ENDL;
@@ -4678,7 +4635,6 @@ void LLAgent::stopFidget()
gAgent.sendAnimationRequests(anims, ANIM_REQUEST_STOP);
}
-
void LLAgent::requestEnterGodMode()
{
LLMessageSystem* msg = gMessageSystem;
@@ -4799,7 +4755,6 @@ void LLAgent::sendAgentUpdateUserInfo(const std::string& directory_visibility)
}
}
-
void LLAgent::updateAgentUserInfoCoro(std::string capurl, std::string directory_visibility)
{
LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp
index 40cb6f6265..cc4599b310 100644
--- a/indra/newview/llagentcamera.cpp
+++ b/indra/newview/llagentcamera.cpp
@@ -1462,13 +1462,12 @@ void LLAgentCamera::updateCamera()
// LL_INFOS() << "Current FOV Zoom: " << mCameraCurrentFOVZoomFactor << " Target FOV Zoom: " << mCameraFOVZoomFactor << " Object penetration: " << mFocusObjectDist << LL_ENDL;
LLVector3 focus_agent = gAgent.getPosAgentFromGlobal(mFocusGlobal);
+ LLVector3 position_agent = gAgent.getPosAgentFromGlobal(camera_pos_global);
- mCameraPositionAgent = gAgent.getPosAgentFromGlobal(camera_pos_global);
+ // Try to move the camera
- // Move the camera
-
- LLViewerCamera::getInstance()->updateCameraLocation(mCameraPositionAgent, mCameraUpVector, focus_agent);
- //LLViewerCamera::getInstance()->updateCameraLocation(mCameraPositionAgent, camera_skyward, focus_agent);
+ if (!LLViewerCamera::getInstance()->updateCameraLocation(position_agent, mCameraUpVector, focus_agent))
+ return;
// Change FOV
LLViewerCamera::getInstance()->setView(LLViewerCamera::getInstance()->getDefaultFOV() / (1.f + mCameraCurrentFOVZoomFactor));
@@ -1476,7 +1475,7 @@ void LLAgentCamera::updateCamera()
// follow camera when in customize mode
if (cameraCustomizeAvatar())
{
- setLookAt(LOOKAT_TARGET_FOCUS, NULL, mCameraPositionAgent);
+ setLookAt(LOOKAT_TARGET_FOCUS, NULL, position_agent);
}
// update the travel distance stat
@@ -1495,8 +1494,8 @@ void LLAgentCamera::updateCamera()
LLVector3 head_pos = gAgentAvatarp->mHeadp->getWorldPosition() +
LLVector3(0.08f, 0.f, 0.05f) * gAgentAvatarp->mHeadp->getWorldRotation() +
LLVector3(0.1f, 0.f, 0.f) * gAgentAvatarp->mPelvisp->getWorldRotation();
- LLVector3 diff = mCameraPositionAgent - head_pos;
- diff = diff * ~gAgentAvatarp->mRoot->getWorldRotation();
+ LLVector3 diff = position_agent - head_pos;
+ diff *= ~gAgentAvatarp->mRoot->getWorldRotation();
LLJoint* torso_joint = gAgentAvatarp->mTorsop;
LLJoint* chest_joint = gAgentAvatarp->mChestp;
@@ -2266,7 +2265,8 @@ void LLAgentCamera::changeCameraToFollow(bool animate)
mCameraMode = CAMERA_MODE_FOLLOW;
// bang-in the current focus, position, and up vector of the follow cam
- mFollowCam.reset(mCameraPositionAgent, LLViewerCamera::getInstance()->getPointOfInterest(), LLVector3::z_axis);
+ const LLViewerCamera& camera = LLViewerCamera::instance();
+ mFollowCam.reset(camera.getOrigin(), camera.getPointOfInterest(), LLVector3::z_axis);
if (gBasicToolset)
{
diff --git a/indra/newview/llagentcamera.h b/indra/newview/llagentcamera.h
index 52571f3c55..d277fd6158 100644
--- a/indra/newview/llagentcamera.h
+++ b/indra/newview/llagentcamera.h
@@ -112,6 +112,7 @@ private:
//--------------------------------------------------------------------
public:
void switchCameraPreset(ECameraPreset preset);
+ ECameraPreset getCameraPreset() const { return mCameraPreset; }
/** Determines default camera offset depending on the current camera preset */
LLVector3 getCameraOffsetInitial();
/** Determines default focus offset depending on the current camera preset */
@@ -138,13 +139,14 @@ private:
//--------------------------------------------------------------------
public:
LLVector3d getCameraPositionGlobal() const;
- const LLVector3 &getCameraPositionAgent() const;
+ const LLVector3& getCameraPositionAgent() const;
LLVector3d calcCameraPositionTargetGlobal(bool *hit_limit = NULL); // Calculate the camera position target
F32 getCameraMinOffGround(); // Minimum height off ground for this mode, meters
void setCameraCollidePlane(const LLVector4 &plane) { mCameraCollidePlane = plane; }
bool calcCameraMinDistance(F32 &obj_min_distance);
- F32 getCurrentCameraBuildOffset() { return (F32)mCameraFocusOffset.length(); }
+ F32 getCurrentCameraBuildOffset() const { return (F32)mCameraFocusOffset.length(); }
void clearCameraLag() { mCameraLag.clearVec(); }
+ const LLVector3& getCameraUpVector() const { return mCameraUpVector; }
private:
LLVector3 getAvatarRootPosition();
@@ -154,7 +156,6 @@ private:
F32 mCameraCurrentFOVZoomFactor; // Interpolated fov zoom
LLVector4 mCameraCollidePlane; // Colliding plane for camera
F32 mCameraZoomFraction; // Mousewheel driven fraction of zoom
- LLVector3 mCameraPositionAgent; // Camera position in agent coordinates
LLVector3 mCameraVirtualPositionAgent; // Camera virtual position (target) before performing FOV zoom
LLVector3d mCameraSmoothingLastPositionGlobal;
LLVector3d mCameraSmoothingLastPositionAgent;
@@ -278,7 +279,7 @@ public:
F32 getAgentHUDTargetZoom();
void resetCameraZoomFraction();
- F32 getCurrentCameraZoomFraction() { return mCameraZoomFraction; }
+ F32 getCurrentCameraZoomFraction() const { return mCameraZoomFraction; }
//--------------------------------------------------------------------
// Pan
diff --git a/indra/newview/llagentpilot.cpp b/indra/newview/llagentpilot.cpp
index 0b5198bbd3..8b18b7d5a2 100644
--- a/indra/newview/llagentpilot.cpp
+++ b/indra/newview/llagentpilot.cpp
@@ -322,9 +322,7 @@ void LLAgentPilot::moveCamera()
LLViewerCamera::getInstance()->setView(view);
LLViewerCamera::getInstance()->setOrigin(origin);
- LLViewerCamera::getInstance()->mXAxis = LLVector3(mat.mMatrix[0]);
- LLViewerCamera::getInstance()->mYAxis = LLVector3(mat.mMatrix[1]);
- LLViewerCamera::getInstance()->mZAxis = LLVector3(mat.mMatrix[2]);
+ LLViewerCamera::getInstance()->setAxes(mat);
}
}
diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp
index 11c5ffecb6..5114ac8a08 100644
--- a/indra/newview/llaisapi.cpp
+++ b/indra/newview/llaisapi.cpp
@@ -839,7 +839,7 @@ void AISAPI::onUpdateReceived(const LLSD& update, COMMAND_TYPE type, const LLSD&
if ( (type == UPDATECATEGORY || type == UPDATEITEM)
&& gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"))
{
- dump_sequential_xml(gAgentAvatarp->getFullname() + "_ais_update", update);
+ dump_sequential_xml(gAgentAvatarp->getDebugName() + "_ais_update", update);
}
AISUpdate ais_update(update, type, request_body);
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 101aca3823..5748d52ab7 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -2042,7 +2042,7 @@ bool LLAppearanceMgr::getCanReplaceCOF(const LLUUID& outfit_cat_id)
}
// Moved from LLWearableList::ContextMenu for wider utility.
-bool LLAppearanceMgr::canAddWearables(const uuid_vec_t& item_ids) const
+bool LLAppearanceMgr::canAddWearables(const uuid_vec_t& item_ids, bool warn_on_type_mismatch) const
{
// TODO: investigate wearables may not be loaded at this point EXT-8231
@@ -2072,7 +2072,10 @@ bool LLAppearanceMgr::canAddWearables(const uuid_vec_t& item_ids) const
}
else
{
+ if (warn_on_type_mismatch)
+ {
LL_WARNS() << "Unexpected wearable type" << LL_ENDL;
+ }
return false;
}
}
@@ -2263,7 +2266,7 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append)
}
if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"))
{
- dump_sequential_xml(gAgentAvatarp->getFullname() + "_slam_request", contents);
+ dump_sequential_xml(gAgentAvatarp->getDebugName() + "_slam_request", contents);
}
slam_inventory_folder(getCOF(), contents, link_waiter);
@@ -3956,7 +3959,7 @@ void LLAppearanceMgr::serverAppearanceUpdateCoro(LLCoreHttpUtil::HttpCoroutineAd
LL_DEBUGS("Avatar") << "succeeded" << LL_ENDL;
if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"))
{
- dump_sequential_xml(gAgentAvatarp->getFullname() + "_appearance_request_ok", result);
+ dump_sequential_xml(gAgentAvatarp->getDebugName() + "_appearance_request_ok", result);
}
} while (bRetry);
@@ -3965,7 +3968,7 @@ void LLAppearanceMgr::serverAppearanceUpdateCoro(LLCoreHttpUtil::HttpCoroutineAd
/*static*/
void LLAppearanceMgr::debugAppearanceUpdateCOF(const LLSD& content)
{
- dump_sequential_xml(gAgentAvatarp->getFullname() + "_appearance_request_error", content);
+ dump_sequential_xml(gAgentAvatarp->getDebugName() + "_appearance_request_error", content);
LL_INFOS("Avatar") << "AIS COF, version received: " << content["expected"].asInteger()
<< " ================================= " << LL_ENDL;
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index 6c45a32856..a6ee62137b 100644
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -102,7 +102,7 @@ public:
bool getCanReplaceCOF(const LLUUID& outfit_cat_id);
// Can we add all referenced items to the avatar?
- bool canAddWearables(const uuid_vec_t& item_ids) const;
+ bool canAddWearables(const uuid_vec_t& item_ids, bool warn_on_type_mismatch = true) const;
// Copy all items in a category.
void shallowCopyCategoryContents(const LLUUID& src_id, const LLUUID& dst_id,
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index c5190fe486..8fdc7f692e 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -453,13 +453,28 @@ static bool app_metrics_qa_mode = false;
void idle_afk_check()
{
+ // Don't check AFK status during startup states
+ if (LLStartUp::getStartupState() < STATE_STARTED)
+ {
+ return;
+ }
+
// check idle timers
F32 current_idle = gAwayTriggerTimer.getElapsedTimeF32();
static LLCachedControl<S32> afk_timeout(gSavedSettings, "AFKTimeout", 300);
- if (afk_timeout() && (current_idle > (F32)afk_timeout()) && !gAgent.getAFK())
+ if (afk_timeout() && (current_idle > afk_timeout()))
{
- LL_INFOS("IdleAway") << "Idle more than " << afk_timeout << " seconds: automatically changing to Away status" << LL_ENDL;
- gAgent.setAFK();
+ if (!gAgent.getAFK())
+ {
+ LL_INFOS("IdleAway") << "Idle more than " << afk_timeout << " seconds: automatically changing to Away status" << LL_ENDL;
+ gAgent.setAFK();
+ }
+ else
+ {
+ // Refresh timer so that random one click or hover won't clear the status.
+ // But expanding the window still should lift afk status
+ gAwayTimer.reset();
+ }
}
}
@@ -1878,36 +1893,6 @@ bool LLAppViewer::cleanup()
// Clean up before GL is shut down because we might be holding on to objects with texture references
LLSelectMgr::cleanupGlobals();
- LL_INFOS() << "Shutting down OpenGL" << LL_ENDL;
-
- // Shut down OpenGL
- if( gViewerWindow)
- {
- gViewerWindow->shutdownGL();
-
- // Destroy window, and make sure we're not fullscreen
- // This may generate window reshape and activation events.
- // Therefore must do this before destroying the message system.
- delete gViewerWindow;
- gViewerWindow = NULL;
- LL_INFOS() << "ViewerWindow deleted" << LL_ENDL;
- }
-
- LLSplashScreen::show();
- LLSplashScreen::update(LLTrans::getString("ShuttingDown"));
-
- LL_INFOS() << "Cleaning up Keyboard & Joystick" << LL_ENDL;
-
- // viewer UI relies on keyboard so keep it aound until viewer UI isa gone
- delete gKeyboard;
- gKeyboard = NULL;
-
- if (LLViewerJoystick::instanceExists())
- {
- // Turn off Space Navigator and similar devices
- LLViewerJoystick::getInstance()->terminate();
- }
-
LL_INFOS() << "Cleaning up Objects" << LL_ENDL;
LLViewerObject::cleanupVOClasses();
@@ -2068,6 +2053,36 @@ bool LLAppViewer::cleanup()
sTextureFetch->shutDownTextureCacheThread() ;
LLLFSThread::sLocal->shutdown();
+ LL_INFOS() << "Shutting down OpenGL" << LL_ENDL;
+
+ // Shut down OpenGL
+ if (gViewerWindow)
+ {
+ gViewerWindow->shutdownGL();
+
+ // Destroy window, and make sure we're not fullscreen
+ // This may generate window reshape and activation events.
+ // Therefore must do this before destroying the message system.
+ delete gViewerWindow;
+ gViewerWindow = NULL;
+ LL_INFOS() << "ViewerWindow deleted" << LL_ENDL;
+ }
+
+ LLSplashScreen::show();
+ LLSplashScreen::update(LLTrans::getString("ShuttingDown"));
+
+ LL_INFOS() << "Cleaning up Keyboard & Joystick" << LL_ENDL;
+
+ // viewer UI relies on keyboard so keep it aound until viewer UI isa gone
+ delete gKeyboard;
+ gKeyboard = NULL;
+
+ if (LLViewerJoystick::instanceExists())
+ {
+ // Turn off Space Navigator and similar devices
+ LLViewerJoystick::getInstance()->terminate();
+ }
+
LL_INFOS() << "Shutting down message system" << LL_ENDL;
end_messaging_system();
diff --git a/indra/newview/llautoreplace.cpp b/indra/newview/llautoreplace.cpp
index f200ca8e31..1ea2899ba4 100644
--- a/indra/newview/llautoreplace.cpp
+++ b/indra/newview/llautoreplace.cpp
@@ -536,11 +536,12 @@ LLAutoReplaceSettings::AddListResult LLAutoReplaceSettings::replaceList(const LL
S32 search_index;
LLSD targetList;
// The following is working around the fact that LLSD arrays containing maps also seem to have undefined entries... see LLSD-30
- for ( search_index = 0, targetList = mLists[0];
+ for ( search_index = 0;
!listFound && search_index < mLists.size();
- search_index += 1, targetList = mLists[search_index]
+ search_index += 1
)
{
+ targetList = mLists[search_index];
if ( targetList.isMap() )
{
if ( listNameMatches( targetList, listName) )
diff --git a/indra/newview/llcontrolavatar.cpp b/indra/newview/llcontrolavatar.cpp
index 9201241856..660fb1b41a 100644
--- a/indra/newview/llcontrolavatar.cpp
+++ b/indra/newview/llcontrolavatar.cpp
@@ -129,14 +129,14 @@ void LLControlAvatar::getNewConstraintFixups(LLVector3& new_pos_fixup, F32& new_
{
LLVector3 pos_box_offset = point_to_box_offset(vol_pos, unshift_extents);
F32 offset_dist = pos_box_offset.length();
- if (offset_dist > MAX_LEGAL_OFFSET && offset_dist > 0.f)
+ if (offset_dist > max_legal_offset && offset_dist > 0.f)
{
- F32 target_dist = (offset_dist - MAX_LEGAL_OFFSET);
+ F32 target_dist = (offset_dist - max_legal_offset);
new_pos_fixup = (target_dist/offset_dist)*pos_box_offset;
}
if (new_pos_fixup != mPositionConstraintFixup)
{
- LL_DEBUGS("ConstraintFix") << getFullname() << " pos fix, offset_dist " << offset_dist << " pos fixup "
+ LL_DEBUGS("ConstraintFix") << getDebugName() << " pos fix, offset_dist " << offset_dist << " pos fixup "
<< new_pos_fixup << " was " << mPositionConstraintFixup << LL_ENDL;
LL_DEBUGS("ConstraintFix") << "vol_pos " << vol_pos << LL_ENDL;
LL_DEBUGS("ConstraintFix") << "extents " << extents[0] << " " << extents[1] << LL_ENDL;
@@ -144,11 +144,11 @@ void LLControlAvatar::getNewConstraintFixups(LLVector3& new_pos_fixup, F32& new_
}
}
- if (box_size/mScaleConstraintFixup > MAX_LEGAL_SIZE)
+ if (box_size/mScaleConstraintFixup > max_legal_size)
{
- new_scale_fixup = mScaleConstraintFixup* MAX_LEGAL_SIZE /box_size;
- LL_DEBUGS("ConstraintFix") << getFullname() << " scale fix, box_size " << box_size << " fixup "
- << mScaleConstraintFixup << " max legal " << MAX_LEGAL_SIZE
+ new_scale_fixup = mScaleConstraintFixup*max_legal_size/box_size;
+ LL_DEBUGS("ConstraintFix") << getDebugName() << " scale fix, box_size " << box_size << " fixup "
+ << mScaleConstraintFixup << " max legal " << max_legal_size
<< " -> new scale " << new_scale_fixup << LL_ENDL;
}
}
@@ -231,7 +231,7 @@ void LLControlAvatar::matchVolumeTransform()
const LLMeshSkinInfo* skin_info = mRootVolp->getSkinInfo();
if (skin_info)
{
- LL_DEBUGS("BindShape") << getFullname() << " bind shape " << skin_info->mBindShapeMatrix << LL_ENDL;
+ LL_DEBUGS("BindShape") << getDebugName() << " bind shape " << skin_info->mBindShapeMatrix << LL_ENDL;
bind_rot = LLSkinningUtil::getUnscaledQuaternion(LLMatrix4(skin_info->mBindShapeMatrix));
}
#endif
diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp
index e6a720e734..cea68c1779 100644
--- a/indra/newview/llconversationlog.cpp
+++ b/indra/newview/llconversationlog.cpp
@@ -663,7 +663,7 @@ void LLConversationLog::onClearLogResponse(const LLSD& notification, const LLSD&
{
mConversations.clear();
notifyObservers();
- cache();
+ saveToFile(getFileName());
deleteBackupLogs();
}
}
diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h
index c1e48c63a9..d5486b9f4a 100644
--- a/indra/newview/llconversationmodel.h
+++ b/indra/newview/llconversationmodel.h
@@ -79,6 +79,9 @@ public:
virtual LLPointer<LLUIImage> getOpenIcon() const { return getIcon(); }
virtual LLFontGL::StyleFlags getLabelStyle() const { return LLFontGL::NORMAL; }
virtual std::string getLabelSuffix() const { return LLStringUtil::null; }
+ virtual bool isFavorite() const { return false; }
+ virtual bool isAgentInventory() const { return false; }
+ virtual bool isAgentInventoryRoot() const { return false; }
virtual bool isItemRenameable() const { return true; }
virtual bool renameItem(const std::string& new_name) { mName = new_name; mNeedsRefresh = true; return true; }
virtual bool isItemMovable( void ) const { return false; }
diff --git a/indra/newview/llfloaterautoreplacesettings.cpp b/indra/newview/llfloaterautoreplacesettings.cpp
index 99f24e161e..d93bd624f5 100644
--- a/indra/newview/llfloaterautoreplacesettings.cpp
+++ b/indra/newview/llfloaterautoreplacesettings.cpp
@@ -422,7 +422,13 @@ bool LLFloaterAutoReplaceSettings::callbackNewListName(const LLSD& notification,
LLSD newList = notification["payload"]["list"];
- if ( response.has("listname") && response["listname"].isString() )
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+ if (option != 1) // Must also match RenameAutoReplaceList
+ {
+ // user cancelled
+ return false;
+ }
+ else if (response.has("listname") && response["listname"].isString() )
{
std::string newName = response["listname"].asString();
LLAutoReplaceSettings::setListName(newList, newName);
@@ -508,12 +514,53 @@ bool LLFloaterAutoReplaceSettings::callbackListNameConflict(const LLSD& notifica
return false;
}
+bool LLFloaterAutoReplaceSettings::callbackRemoveList(const LLSD& notification, const LLSD& response)
+{
+ std::string listName = notification["payload"]["list"];
+
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+ switch (option)
+ {
+ case 1:
+ if (mSettings.removeReplacementList(listName))
+ {
+ LL_INFOS("AutoReplace") << "deleted list '" << listName << "'" << LL_ENDL;
+ mReplacementsList->deleteSelectedItems(); // remove from the scrolling list
+ mSelectedListName.clear();
+ updateListNames();
+ updateListNamesControls();
+ updateReplacementsList();
+ }
+ break;
+ case 0:
+ break;
+
+ default:
+ LL_ERRS("AutoReplace") << "invalid selected option " << option << LL_ENDL;
+ }
+
+ return false;
+}
+
void LLFloaterAutoReplaceSettings::onDeleteList()
{
std::string listName = mListNames->getSelectedValue().asString();
if ( ! listName.empty() )
{
- if ( mSettings.removeReplacementList(listName) )
+ const LLSD* mappings = mSettings.getListEntries(mSelectedListName);
+ if (mappings->size() > 0)
+ {
+ LLSD payload;
+ payload["list"] = listName;
+
+ LLSD args;
+ args["MAP_SIZE"] = llformat("%d",mappings->size());
+ args["LIST_NAME"] = listName;
+
+ LLNotificationsUtil::add("RemoveAutoReplaceList", args, payload,
+ boost::bind(&LLFloaterAutoReplaceSettings::callbackRemoveList, this, _1, _2));
+ }
+ else if ( mSettings.removeReplacementList(listName) )
{
LL_INFOS("AutoReplace")<<"deleted list '"<<listName<<"'"<<LL_ENDL;
mReplacementsList->deleteSelectedItems(); // remove from the scrolling list
diff --git a/indra/newview/llfloaterautoreplacesettings.h b/indra/newview/llfloaterautoreplacesettings.h
index 94a7c00c15..1a8068ab7c 100644
--- a/indra/newview/llfloaterautoreplacesettings.h
+++ b/indra/newview/llfloaterautoreplacesettings.h
@@ -105,6 +105,8 @@ private:
bool callbackNewListName(const LLSD& notification, const LLSD& response);
/// called from the RenameAutoReplaceList notification dialog
bool callbackListNameConflict(const LLSD& notification, const LLSD& response);
+ /// called from the RemoveAutoReplaceList notification dialog
+ bool callbackRemoveList(const LLSD& notification, const LLSD& response);
bool selectedListIsFirst();
bool selectedListIsLast();
diff --git a/indra/newview/llfloaterbvhpreview.cpp b/indra/newview/llfloaterbvhpreview.cpp
index b94c31ec04..7450be45f1 100644
--- a/indra/newview/llfloaterbvhpreview.cpp
+++ b/indra/newview/llfloaterbvhpreview.cpp
@@ -118,8 +118,8 @@ std::string STATUS[] =
//-----------------------------------------------------------------------------
// LLFloaterBvhPreview()
//-----------------------------------------------------------------------------
-LLFloaterBvhPreview::LLFloaterBvhPreview(const std::string& filename) :
- LLFloaterNameDesc(filename)
+LLFloaterBvhPreview::LLFloaterBvhPreview(const LLSD& args) :
+ LLFloaterNameDesc(args)
{
mLastMouseX = 0;
mLastMouseY = 0;
@@ -1028,7 +1028,8 @@ void LLFloaterBvhPreview::onBtnOK(void* userdata)
LLFloaterPerms::getNextOwnerPerms("Uploads"),
LLFloaterPerms::getGroupPerms("Uploads"),
LLFloaterPerms::getEveryonePerms("Uploads"),
- expected_upload_cost));
+ expected_upload_cost,
+ floaterp->mDestinationFolderId));
upload_new_resource(assetUploadInfo);
}
diff --git a/indra/newview/llfloaterbvhpreview.h b/indra/newview/llfloaterbvhpreview.h
index ae64521492..c6b75c00b2 100644
--- a/indra/newview/llfloaterbvhpreview.h
+++ b/indra/newview/llfloaterbvhpreview.h
@@ -70,7 +70,7 @@ protected:
class LLFloaterBvhPreview : public LLFloaterNameDesc
{
public:
- LLFloaterBvhPreview(const std::string& filename);
+ LLFloaterBvhPreview(const LLSD& args);
virtual ~LLFloaterBvhPreview();
bool postBuild();
diff --git a/indra/newview/llfloatereditenvironmentbase.h b/indra/newview/llfloatereditenvironmentbase.h
index 37fda5d33e..41192f3d30 100644
--- a/indra/newview/llfloatereditenvironmentbase.h
+++ b/indra/newview/llfloatereditenvironmentbase.h
@@ -133,7 +133,8 @@ protected:
LLSettingsEditPanel() :
LLPanel(),
mIsDirty(false),
- mOnDirtyChanged()
+ mOnDirtyChanged(),
+ mCanEdit(false)
{}
private:
diff --git a/indra/newview/llfloaterenvironmentadjust.cpp b/indra/newview/llfloaterenvironmentadjust.cpp
index 35f8340997..58616995d3 100644
--- a/indra/newview/llfloaterenvironmentadjust.cpp
+++ b/indra/newview/llfloaterenvironmentadjust.cpp
@@ -455,9 +455,29 @@ void LLFloaterEnvironmentAdjust::onMoonAzimElevChanged()
void LLFloaterEnvironmentAdjust::onCloudMapChanged()
{
if (!mLiveSky)
+ {
return;
- mLiveSky->setCloudNoiseTextureId(getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP)->getValue().asUUID());
- mLiveSky->update();
+ }
+
+ LLTextureCtrl* picker_ctrl = getChild<LLTextureCtrl>(FIELD_SKY_CLOUD_MAP);
+
+ LLUUID new_texture_id = picker_ctrl->getValue().asUUID();
+
+ LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL);
+
+ LLSettingsSky::ptr_t sky_to_set = mLiveSky->buildClone();
+ if (!sky_to_set)
+ {
+ return;
+ }
+
+ sky_to_set->setCloudNoiseTextureId(new_texture_id);
+
+ LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, sky_to_set);
+
+ LLEnvironment::instance().updateEnvironment(LLEnvironment::TRANSITION_INSTANT, true);
+
+ picker_ctrl->setValue(new_texture_id);
}
void LLFloaterEnvironmentAdjust::onWaterMapChanged()
diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp
index 989e1d8d04..f254fdafaf 100644
--- a/indra/newview/llfloaterimagepreview.cpp
+++ b/indra/newview/llfloaterimagepreview.cpp
@@ -72,8 +72,8 @@ const S32 PREVIEW_TEXTURE_HEIGHT = 320;
//-----------------------------------------------------------------------------
// LLFloaterImagePreview()
//-----------------------------------------------------------------------------
-LLFloaterImagePreview::LLFloaterImagePreview(const std::string& filename) :
- LLFloaterNameDesc(filename),
+LLFloaterImagePreview::LLFloaterImagePreview(const LLSD& args) :
+ LLFloaterNameDesc(args),
mAvatarPreview(NULL),
mSculptedPreview(NULL),
diff --git a/indra/newview/llfloaterimagepreview.h b/indra/newview/llfloaterimagepreview.h
index ed395722de..9bc57246cf 100644
--- a/indra/newview/llfloaterimagepreview.h
+++ b/indra/newview/llfloaterimagepreview.h
@@ -110,7 +110,7 @@ protected:
class LLFloaterImagePreview : public LLFloaterNameDesc
{
public:
- LLFloaterImagePreview(const std::string& filename);
+ LLFloaterImagePreview(const LLSD& args);
virtual ~LLFloaterImagePreview();
bool postBuild() override;
diff --git a/indra/newview/llfloaterinventorysettings.cpp b/indra/newview/llfloaterinventorysettings.cpp
index e5ee69f240..aab632bcb8 100644
--- a/indra/newview/llfloaterinventorysettings.cpp
+++ b/indra/newview/llfloaterinventorysettings.cpp
@@ -28,9 +28,14 @@
#include "llfloaterinventorysettings.h"
+#include "llcolorswatch.h"
+#include "llviewercontrol.h"
+
LLFloaterInventorySettings::LLFloaterInventorySettings(const LLSD& key)
: LLFloater(key)
{
+ mCommitCallbackRegistrar.add("ScriptPref.applyUIColor", boost::bind(&LLFloaterInventorySettings::applyUIColor, this, _1, _2));
+ mCommitCallbackRegistrar.add("ScriptPref.getUIColor", boost::bind(&LLFloaterInventorySettings::getUIColor, this, _1, _2));
}
LLFloaterInventorySettings::~LLFloaterInventorySettings()
@@ -39,6 +44,29 @@ LLFloaterInventorySettings::~LLFloaterInventorySettings()
bool LLFloaterInventorySettings::postBuild()
{
getChild<LLButton>("ok_btn")->setCommitCallback(boost::bind(&LLFloater::closeFloater, this, false));
+
+ getChild<LLUICtrl>("favorites_color")->setCommitCallback(boost::bind(&LLFloaterInventorySettings::updateColorSwatch, this));
+
+ bool enable_color = gSavedSettings.getBOOL("InventoryFavoritesColorText");
+ getChild<LLUICtrl>("favorites_swatch")->setEnabled(enable_color);
+
return true;
}
+void LLFloaterInventorySettings::updateColorSwatch()
+{
+ bool val = getChild<LLUICtrl>("favorites_color")->getValue();
+ getChild<LLUICtrl>("favorites_swatch")->setEnabled(val);
+}
+
+void LLFloaterInventorySettings::applyUIColor(LLUICtrl* ctrl, const LLSD& param)
+{
+ LLUIColorTable::instance().setColor(param.asString(), LLColor4(ctrl->getValue()));
+}
+
+void LLFloaterInventorySettings::getUIColor(LLUICtrl* ctrl, const LLSD& param)
+{
+ LLColorSwatchCtrl* color_swatch = (LLColorSwatchCtrl*)ctrl;
+ color_swatch->setOriginal(LLUIColorTable::instance().getColor(param.asString()));
+}
+
diff --git a/indra/newview/llfloaterinventorysettings.h b/indra/newview/llfloaterinventorysettings.h
index 3fe3a001b9..c27d5d2e1b 100644
--- a/indra/newview/llfloaterinventorysettings.h
+++ b/indra/newview/llfloaterinventorysettings.h
@@ -40,6 +40,11 @@ public:
private:
LLFloaterInventorySettings(const LLSD& key);
~LLFloaterInventorySettings();
+
+ void updateColorSwatch();
+
+ void applyUIColor(LLUICtrl* ctrl, const LLSD& param);
+ void getUIColor(LLUICtrl* ctrl, const LLSD& param);
};
#endif
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 8332a430e6..b5489d2dd8 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -349,14 +349,14 @@ void LLFloaterModelPreview::initModelPreview()
}
//static
-bool LLFloaterModelPreview::showModelPreview()
+void LLFloaterModelPreview::showModelPreview(const LLUUID& dest_folder)
{
LLFloaterModelPreview* fmp = (LLFloaterModelPreview*)LLFloaterReg::getInstance("upload_model");
if (fmp && !fmp->isModelLoading())
{
+ fmp->setUploadDestination(dest_folder);
fmp->loadHighLodModel();
}
- return true;
}
void LLFloaterModelPreview::onUploadOptionChecked(LLUICtrl* ctrl)
@@ -505,7 +505,7 @@ void LLFloaterModelPreview::onClickCalculateBtn()
gMeshRepo.uploadModel(mModelPreview->mUploadData, mModelPreview->mPreviewScale,
childGetValue("upload_textures").asBoolean(),
upload_skinweights, upload_joint_positions, lock_scale_if_joint_position,
- mUploadModelUrl, false,
+ mUploadModelUrl, mDestinationFolderId, false,
getWholeModelFeeObserverHandle());
toggleCalculateButton(false);
@@ -1660,7 +1660,7 @@ void LLFloaterModelPreview::onUpload(void* user_data)
gMeshRepo.uploadModel(mp->mModelPreview->mUploadData, mp->mModelPreview->mPreviewScale,
mp->childGetValue("upload_textures").asBoolean(),
upload_skinweights, upload_joint_positions, lock_scale_if_joint_position,
- mp->mUploadModelUrl,
+ mp->mUploadModelUrl, mp->mDestinationFolderId,
true, LLHandle<LLWholeModelFeeObserver>(), mp->getWholeModelUploadObserverHandle());
}
@@ -1770,9 +1770,15 @@ void LLFloaterModelPreview::onLoDSourceCommit(S32 lod)
if (index == LLModelPreview::MESH_OPTIMIZER_AUTO
|| index == LLModelPreview::MESH_OPTIMIZER_SLOPPY
|| index == LLModelPreview::MESH_OPTIMIZER_PRECISE)
- { //rebuild LoD to update triangle counts
+ {
+ // rebuild LoD to update triangle counts
onLODParamCommit(lod, true);
}
+ if (index == LLModelPreview::USE_LOD_ABOVE)
+ {
+ // refresh to pick triangle counts
+ mModelPreview->mDirty = true;
+ }
}
void LLFloaterModelPreview::resetDisplayOptions()
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index 6adc084fe8..7b652a3613 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -73,7 +73,8 @@ public:
/*virtual*/ void reshape(S32 width, S32 height, bool called_from_parent = true);
void initModelPreview();
- static bool showModelPreview();
+ void setUploadDestination(const LLUUID& dest_folder) { mDestinationFolderId = dest_folder; }
+ static void showModelPreview(const LLUUID& dest_folder = LLUUID::null);
bool handleMouseDown(S32 x, S32 y, MASK mask);
bool handleMouseUp(S32 x, S32 y, MASK mask);
@@ -164,9 +165,6 @@ protected:
static void onPhysicsBrowse(LLUICtrl* ctrl, void* userdata);
static void onPhysicsUseLOD(LLUICtrl* ctrl, void* userdata);
- static void onPhysicsOptimize(LLUICtrl* ctrl, void* userdata);
- static void onPhysicsDecomposeBack(LLUICtrl* ctrl, void* userdata);
- static void onPhysicsSimplifyBack(LLUICtrl* ctrl, void* userdata);
void draw();
@@ -225,6 +223,7 @@ private:
void createSmoothComboBox(LLComboBox* combo_box, float min, float max);
+ LLUUID mDestinationFolderId;
LLButton* mUploadBtn;
LLButton* mCalculateBtn;
LLViewerTextEditor* mUploadLogText;
diff --git a/indra/newview/llfloatermyenvironment.cpp b/indra/newview/llfloatermyenvironment.cpp
index 891e16a8ef..c0405c106e 100644
--- a/indra/newview/llfloatermyenvironment.cpp
+++ b/indra/newview/llfloatermyenvironment.cpp
@@ -38,7 +38,9 @@
#include "llcheckboxctrl.h"
#include "llviewerinventory.h"
#include "llenvironment.h"
+#include "llnotificationsutil.h"
#include "llparcel.h"
+#include "lltrans.h"
#include "llviewerparcelmgr.h"
//=========================================================================
@@ -223,16 +225,13 @@ void LLFloaterMyEnvironment::onFilterEdit(const std::string& search_string)
mInventoryList->setFilterSubString(search_string);
}
-void LLFloaterMyEnvironment::onDeleteSelected()
+void LLFloaterMyEnvironment::onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response, uuid_vec_t item_ids)
+{
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+ if (option == 0)
{
- uuid_vec_t selected;
-
- getSelectedIds(selected);
- if (selected.empty())
- return;
-
const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
- for (const LLUUID& itemid: selected)
+ for (const LLUUID& itemid : item_ids)
{
LLInventoryItem* inv_item = gInventory.getItem(itemid);
@@ -253,6 +252,27 @@ void LLFloaterMyEnvironment::onDeleteSelected()
}
gInventory.notifyObservers();
}
+}
+
+void LLFloaterMyEnvironment::onDeleteSelected()
+{
+ uuid_vec_t selected;
+
+ getSelectedIds(selected);
+ if (selected.empty())
+ return;
+
+ LLSD args;
+ args["QUESTION"] = LLTrans::getString(selected.size() > 1 ? "DeleteItems" : "DeleteItem");
+ LLNotificationsUtil::add(
+ "DeleteItems",
+ args,
+ LLSD(),
+ [this, selected](const LLSD& notification, const LLSD& response)
+ {
+ onItemsRemovalConfirmation(notification, response, selected);
+ });
+}
void LLFloaterMyEnvironment::onDoCreate(const LLSD &data)
@@ -318,13 +338,13 @@ bool LLFloaterMyEnvironment::canAction(const std::string &context)
if (context == PARAMETER_EDIT)
{
- return (selected.size() == 1) && isSettingSelected(selected.front());
+ return (selected.size() == 1) && isSettingId(selected.front());
}
else if (context == PARAMETER_COPY)
{
for (std::vector<LLUUID>::iterator it = selected.begin(); it != selected.end(); it++)
{
- if(!isSettingSelected(*it))
+ if(!isSettingId(*it))
{
return false;
}
@@ -342,7 +362,7 @@ bool LLFloaterMyEnvironment::canAction(const std::string &context)
LLClipboard::instance().pasteFromClipboard(ids);
for (std::vector<LLUUID>::iterator it = ids.begin(); it != ids.end(); it++)
{
- if (!isSettingSelected(*it))
+ if (!isSettingId(*it))
{
return false;
}
@@ -351,7 +371,7 @@ bool LLFloaterMyEnvironment::canAction(const std::string &context)
}
else if (context == PARAMETER_COPYUUID)
{
- return (selected.size() == 1) && isSettingSelected(selected.front());
+ return (selected.size() == 1) && isSettingId(selected.front());
}
return false;
@@ -367,16 +387,42 @@ bool LLFloaterMyEnvironment::canApply(const std::string &context)
if (context == PARAMETER_REGION)
{
- return LLEnvironment::instance().canAgentUpdateRegionEnvironment();
+ return isSettingId(selected.front()) && LLEnvironment::instance().canAgentUpdateRegionEnvironment();
}
else if (context == PARAMETER_PARCEL)
{
- return LLEnvironment::instance().canAgentUpdateParcelEnvironment();
+ return isSettingId(selected.front()) && LLEnvironment::instance().canAgentUpdateParcelEnvironment();
}
- else
+ else if (context == PARAMETER_LOCAL)
{
- return (context == PARAMETER_LOCAL);
+ return isSettingId(selected.front());
}
+
+ return false;
+}
+
+bool can_delete(const LLUUID& id)
+{
+ const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
+ if (id == trash_id || gInventory.isObjectDescendentOf(id, trash_id))
+ {
+ return false;
+ }
+
+ LLViewerInventoryCategory* cat = gInventory.getCategory(id);
+ if (cat)
+ {
+ if (!get_is_category_removable(&gInventory, id))
+ {
+ return false;
+ }
+ }
+ else if (!get_is_item_removable(&gInventory, id, false))
+ {
+ return false;
+ }
+
+ return true;
}
//-------------------------------------------------------------------------
@@ -389,7 +435,14 @@ void LLFloaterMyEnvironment::refreshButtonStates()
getChild<LLUICtrl>(BUTTON_GEAR)->setEnabled(settings_ok);
getChild<LLUICtrl>(BUTTON_NEWSETTINGS)->setEnabled(true);
- getChild<LLUICtrl>(BUTTON_DELETE)->setEnabled(settings_ok && !selected.empty());
+
+ bool enable_delete = false;
+ if(settings_ok && !selected.empty())
+ {
+ enable_delete = can_delete(selected.front());
+ }
+
+ getChild<LLUICtrl>(BUTTON_DELETE)->setEnabled(enable_delete);
}
//-------------------------------------------------------------------------
@@ -438,7 +491,7 @@ LLUUID LLFloaterMyEnvironment::findItemByAssetId(LLUUID asset_id, bool copyable_
return LLUUID::null;
}
-bool LLFloaterMyEnvironment::isSettingSelected(LLUUID item_id)
+bool LLFloaterMyEnvironment::isSettingId(const LLUUID& item_id)
{
LLInventoryItem* itemp = gInventory.getItem(item_id);
diff --git a/indra/newview/llfloatermyenvironment.h b/indra/newview/llfloatermyenvironment.h
index 8e81b8e5e2..c5d521d207 100644
--- a/indra/newview/llfloatermyenvironment.h
+++ b/indra/newview/llfloatermyenvironment.h
@@ -60,6 +60,7 @@ private:
void onFilterCheckChange();
void onFilterEdit(const std::string& search_string);
void onSelectionChange();
+ void onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response, uuid_vec_t item_ids);
void onDeleteSelected();
void onDoCreate(const LLSD &data);
void onDoApply(const std::string &context);
@@ -69,7 +70,7 @@ private:
void getSelectedIds(uuid_vec_t& ids) const;
void refreshButtonStates();
- bool isSettingSelected(LLUUID item_id);
+ static bool isSettingId(const LLUUID &item_id);
static LLUUID findItemByAssetId(LLUUID asset_id, bool copyable_only, bool ignore_library);
};
diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp
index 01c50d89c5..569b41cfa9 100644
--- a/indra/newview/llfloaternamedesc.cpp
+++ b/indra/newview/llfloaternamedesc.cpp
@@ -62,11 +62,20 @@ const S32 PREVIEW_HPAD = PREVIEW_RESIZE_HANDLE_SIZE;
//-----------------------------------------------------------------------------
// LLFloaterNameDesc()
//-----------------------------------------------------------------------------
-LLFloaterNameDesc::LLFloaterNameDesc(const LLSD& filename )
- : LLFloater(filename),
- mIsAudio(false)
+LLFloaterNameDesc::LLFloaterNameDesc(const LLSD& args)
+ : LLFloater(args)
+ , mIsAudio(false)
+ , mIsText(false)
{
- mFilenameAndPath = filename.asString();
+ if (args.isString())
+ {
+ mFilenameAndPath = args.asString();
+ }
+ else
+ {
+ mFilenameAndPath = args["filename"].asString();
+ mDestinationFolderId = args["dest"].asUUID();
+ }
mFilename = gDirUtilp->getBaseFileName(mFilenameAndPath, false);
}
@@ -203,7 +212,8 @@ void LLFloaterNameDesc::onBtnOK( )
LLFloaterPerms::getNextOwnerPerms("Uploads"),
LLFloaterPerms::getGroupPerms("Uploads"),
LLFloaterPerms::getEveryonePerms("Uploads"),
- expected_upload_cost));
+ expected_upload_cost,
+ mDestinationFolderId));
upload_new_resource(uploadInfo, callback, nruserdata);
}
@@ -230,8 +240,8 @@ void LLFloaterNameDesc::onBtnCancel()
// LLFloaterSoundPreview()
//-----------------------------------------------------------------------------
-LLFloaterSoundPreview::LLFloaterSoundPreview(const LLSD& filename )
- : LLFloaterNameDesc(filename)
+LLFloaterSoundPreview::LLFloaterSoundPreview(const LLSD& args )
+ : LLFloaterNameDesc(args)
{
mIsAudio = true;
}
@@ -251,8 +261,8 @@ bool LLFloaterSoundPreview::postBuild()
// LLFloaterAnimPreview()
//-----------------------------------------------------------------------------
-LLFloaterAnimPreview::LLFloaterAnimPreview(const LLSD& filename )
- : LLFloaterNameDesc(filename)
+LLFloaterAnimPreview::LLFloaterAnimPreview(const LLSD& args )
+ : LLFloaterNameDesc(args)
{
}
@@ -270,8 +280,8 @@ bool LLFloaterAnimPreview::postBuild()
// LLFloaterScriptPreview()
//-----------------------------------------------------------------------------
-LLFloaterScriptPreview::LLFloaterScriptPreview(const LLSD& filename )
- : LLFloaterNameDesc(filename)
+LLFloaterScriptPreview::LLFloaterScriptPreview(const LLSD& args )
+ : LLFloaterNameDesc(args)
{
mIsText = true;
}
diff --git a/indra/newview/llfloaternamedesc.h b/indra/newview/llfloaternamedesc.h
index aa5571ccc0..8c8ec49a8e 100644
--- a/indra/newview/llfloaternamedesc.h
+++ b/indra/newview/llfloaternamedesc.h
@@ -39,7 +39,7 @@ class LLRadioGroup;
class LLFloaterNameDesc : public LLFloater
{
public:
- LLFloaterNameDesc(const LLSD& filename);
+ LLFloaterNameDesc(const LLSD& args);
virtual ~LLFloaterNameDesc();
bool postBuild() override;
@@ -58,6 +58,7 @@ protected:
std::string mFilenameAndPath;
std::string mFilename;
+ LLUUID mDestinationFolderId;
};
class LLFloaterSoundPreview : public LLFloaterNameDesc
diff --git a/indra/newview/llfloaterobjectweights.cpp b/indra/newview/llfloaterobjectweights.cpp
index 26b7304b9a..fa491a4b27 100644
--- a/indra/newview/llfloaterobjectweights.cpp
+++ b/indra/newview/llfloaterobjectweights.cpp
@@ -36,6 +36,14 @@
#include "llviewerparcelmgr.h"
#include "llviewerregion.h"
+static const std::string lod_strings[4] =
+{
+ "lowest_lod",
+ "low_lod",
+ "medium_lod",
+ "high_lod",
+};
+
// virtual
bool LLCrossParcelFunctor::apply(LLViewerObject* obj)
{
@@ -75,7 +83,10 @@ LLFloaterObjectWeights::LLFloaterObjectWeights(const LLSD& key)
mSelectedOnLand(NULL),
mRezzedOnLand(NULL),
mRemainingCapacity(NULL),
- mTotalCapacity(NULL)
+ mTotalCapacity(NULL),
+ mLodLevel(nullptr),
+ mTrianglesShown(nullptr),
+ mPixelArea(nullptr)
{
}
@@ -99,6 +110,10 @@ bool LLFloaterObjectWeights::postBuild()
mRemainingCapacity = getChild<LLTextBox>("remaining_capacity");
mTotalCapacity = getChild<LLTextBox>("total_capacity");
+ mLodLevel = getChild<LLTextBox>("lod_level");
+ mTrianglesShown = getChild<LLTextBox>("triangles_shown");
+ mPixelArea = getChild<LLTextBox>("pixel_area");
+
return true;
}
@@ -135,6 +150,69 @@ void LLFloaterObjectWeights::setErrorStatus(S32 status, const std::string& reaso
toggleWeightsLoadingIndicators(false);
}
+void LLFloaterObjectWeights::draw()
+{
+ // Normally it's a bad idea to set text and visibility inside draw
+ // since it can cause rect updates go to different, already drawn elements,
+ // but floater is very simple and these elements are supposed to be isolated
+ LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
+ if (selection->isEmpty())
+ {
+ const std::string text = getString("nothing_selected");
+ mLodLevel->setText(text);
+ mTrianglesShown->setText(text);
+ mPixelArea->setText(text);
+
+ toggleRenderLoadingIndicators(false);
+ }
+ else
+ {
+ S32 object_lod = -1;
+ bool multiple_lods = false;
+ S32 total_tris = 0;
+ F32 pixel_area = 0;
+ for (LLObjectSelection::valid_root_iterator iter = selection->valid_root_begin();
+ iter != selection->valid_root_end(); ++iter)
+ {
+ LLViewerObject* object = (*iter)->getObject();
+ S32 lod = object->getLOD();
+ if (object_lod < 0)
+ {
+ object_lod = lod;
+ }
+ else if (object_lod != lod)
+ {
+ multiple_lods = true;
+ }
+
+ if (object->isRootEdit())
+ {
+ total_tris += object->recursiveGetTriangleCount();
+ pixel_area += object->getPixelArea();
+ }
+ }
+
+ if (multiple_lods)
+ {
+ mLodLevel->setText(getString("multiple_lods"));
+ toggleRenderLoadingIndicators(false);
+ }
+ else if (object_lod < 0)
+ {
+ // nodes are waiting for data
+ toggleRenderLoadingIndicators(true);
+ }
+ else
+ {
+ mLodLevel->setText(getString(lod_strings[object_lod]));
+ toggleRenderLoadingIndicators(false);
+ }
+ mTrianglesShown->setText(llformat("%d", total_tris));
+ mPixelArea->setText(llformat("%d", pixel_area));
+ }
+ LLFloater::draw();
+}
+
void LLFloaterObjectWeights::updateLandImpacts(const LLParcel* parcel)
{
if (!parcel || LLSelectMgr::getInstance()->getSelection()->isEmpty())
@@ -252,6 +330,17 @@ void LLFloaterObjectWeights::toggleLandImpactsLoadingIndicators(bool visible)
mTotalCapacity->setVisible(!visible);
}
+void LLFloaterObjectWeights::toggleRenderLoadingIndicators(bool visible)
+{
+ childSetVisible("lod_level_loading_indicator", visible);
+ childSetVisible("triangles_shown_loading_indicator", visible);
+ childSetVisible("pixel_area_loading_indicator", visible);
+
+ mLodLevel->setVisible(!visible);
+ mTrianglesShown->setVisible(!visible);
+ mPixelArea->setVisible(!visible);
+}
+
void LLFloaterObjectWeights::updateIfNothingSelected()
{
const std::string text = getString("nothing_selected");
@@ -269,6 +358,11 @@ void LLFloaterObjectWeights::updateIfNothingSelected()
mRemainingCapacity->setText(text);
mTotalCapacity->setText(text);
+ mLodLevel->setText(text);
+ mTrianglesShown->setText(text);
+ mPixelArea->setText(text);
+
toggleWeightsLoadingIndicators(false);
toggleLandImpactsLoadingIndicators(false);
+ toggleRenderLoadingIndicators(false);
}
diff --git a/indra/newview/llfloaterobjectweights.h b/indra/newview/llfloaterobjectweights.h
index 3b999f6b9b..bda625564b 100644
--- a/indra/newview/llfloaterobjectweights.h
+++ b/indra/newview/llfloaterobjectweights.h
@@ -58,21 +58,24 @@ public:
LLFloaterObjectWeights(const LLSD& key);
~LLFloaterObjectWeights();
- /*virtual*/ bool postBuild();
+ bool postBuild() override;
- /*virtual*/ void onOpen(const LLSD& key);
+ void onOpen(const LLSD& key) override;
- /*virtual*/ void onWeightsUpdate(const SelectionCost& selection_cost);
- /*virtual*/ void setErrorStatus(S32 status, const std::string& reason);
+ void onWeightsUpdate(const SelectionCost& selection_cost) override;
+ void setErrorStatus(S32 status, const std::string& reason) override;
+
+ void draw() override;
void updateLandImpacts(const LLParcel* parcel);
- void refresh();
+ void refresh() override;
private:
- /*virtual*/ void generateTransactionID();
+ void generateTransactionID() override;
void toggleWeightsLoadingIndicators(bool visible);
void toggleLandImpactsLoadingIndicators(bool visible);
+ void toggleRenderLoadingIndicators(bool visible);
void updateIfNothingSelected();
@@ -88,6 +91,10 @@ private:
LLTextBox *mRezzedOnLand;
LLTextBox *mRemainingCapacity;
LLTextBox *mTotalCapacity;
+
+ LLTextBox *mLodLevel;
+ LLTextBox *mTrianglesShown;
+ LLTextBox *mPixelArea;
};
#endif //LL_LLFLOATEROBJECTWEIGHTS_H
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index fdac390e8a..c881821153 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -1968,7 +1968,21 @@ void LLFloaterPreference::selectChatPanel()
void LLFloaterPreference::changed()
{
+ if (LLConversationLog::instance().getIsLoggingEnabled())
+ {
getChild<LLButton>("clear_log")->setEnabled(LLConversationLog::instance().getConversations().size() > 0);
+ }
+ else
+ {
+ // onClearLog clears list, then notifies changed() and only then clears file,
+ // so check presence of conversations before checking file, file will cleared later.
+ llstat st;
+ bool has_logs = LLConversationLog::instance().getConversations().size() > 0
+ && LLFile::stat(LLConversationLog::instance().getFileName(), &st) == 0
+ && S_ISREG(st.st_mode)
+ && st.st_size > 0;
+ getChild<LLButton>("clear_log")->setEnabled(has_logs);
+ }
// set 'enable' property for 'Delete transcripts...' button
updateDeleteTranscriptsButton();
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index 30ed723db6..a798ba31ee 100755
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
@@ -486,8 +486,11 @@ void LLFloaterWorldMap::onOpen(const LLSD& key)
const LLUUID landmark_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK);
LLInventoryModelBackgroundFetch::instance().start(landmark_folder_id);
- mLocationEditor->setFocus( true);
- gFocusMgr.triggerFocusFlash();
+ if (hasFocus())
+ {
+ mLocationEditor->setFocus( true);
+ gFocusMgr.triggerFocusFlash();
+ }
buildAvatarIDList();
buildLandmarkIDLists();
diff --git a/indra/newview/llfolderviewmodelinventory.cpp b/indra/newview/llfolderviewmodelinventory.cpp
index c668d414d3..9223c13ec1 100644
--- a/indra/newview/llfolderviewmodelinventory.cpp
+++ b/indra/newview/llfolderviewmodelinventory.cpp
@@ -68,9 +68,10 @@ void LLFolderViewModelInventory::sort( LLFolderViewFolder* folder )
if (!folder->areChildrenInited() || !needsSort(folder->getViewModelItem())) return;
- LLFolderViewModelItemInventory* modelp = static_cast<LLFolderViewModelItemInventory*>(folder->getViewModelItem());
- if (modelp->getUUID().isNull()) return;
+ LLFolderViewModelItemInventory* sort_modelp = static_cast<LLFolderViewModelItemInventory*>(folder->getViewModelItem());
+ if (sort_modelp->getUUID().isNull()) return;
+ bool has_favorites = false;
for (std::list<LLFolderViewFolder*>::iterator it = folder->getFoldersBegin(), end_it = folder->getFoldersEnd();
it != end_it;
++it)
@@ -79,11 +80,14 @@ void LLFolderViewModelInventory::sort( LLFolderViewFolder* folder )
LLFolderViewFolder* child_folderp = *it;
sort(child_folderp);
+ LLFolderViewModelItemInventory* modelp = static_cast<LLFolderViewModelItemInventory*>(child_folderp->getViewModelItem());
+ has_favorites |= child_folderp->isFavorite() || child_folderp->hasFavorites();
+
if (child_folderp->getFoldersCount() > 0)
{
- time_t most_recent_folder_time =
- static_cast<LLFolderViewModelItemInventory*>((*child_folderp->getFoldersBegin())->getViewModelItem())->getCreationDate();
- LLFolderViewModelItemInventory* modelp = static_cast<LLFolderViewModelItemInventory*>(child_folderp->getViewModelItem());
+ LLFolderViewModelItemInventory* folderp = static_cast<LLFolderViewModelItemInventory*>((*child_folderp->getFoldersBegin())->getViewModelItem());
+ time_t most_recent_folder_time = folderp->getCreationDate();
+
if (most_recent_folder_time > modelp->getCreationDate())
{
modelp->setCreationDate(most_recent_folder_time);
@@ -91,16 +95,26 @@ void LLFolderViewModelInventory::sort( LLFolderViewFolder* folder )
}
if (child_folderp->getItemsCount() > 0)
{
- time_t most_recent_item_time =
- static_cast<LLFolderViewModelItemInventory*>((*child_folderp->getItemsBegin())->getViewModelItem())->getCreationDate();
+ LLFolderViewModelItemInventory* itemp = static_cast<LLFolderViewModelItemInventory*>((*child_folderp->getItemsBegin())->getViewModelItem());
+ time_t most_recent_item_time = itemp->getCreationDate();
- LLFolderViewModelItemInventory* modelp = static_cast<LLFolderViewModelItemInventory*>(child_folderp->getViewModelItem());
if (most_recent_item_time > modelp->getCreationDate())
{
modelp->setCreationDate(most_recent_item_time);
}
}
}
+ for (std::list<LLFolderViewItem*>::const_iterator it = folder->getItemsBegin(), end_it = folder->getItemsEnd();
+ it != end_it && !has_favorites;
+ ++it)
+ {
+ LLFolderViewItem* child_itemp = *it;
+ has_favorites |= child_itemp->isFavorite();
+ }
+ if (has_favorites)
+ {
+ folder->updateHasFavorites(true);
+ }
base_t::sort(folder);
}
diff --git a/indra/newview/llfolderviewmodelinventory.h b/indra/newview/llfolderviewmodelinventory.h
index 48b4ee5fd9..04b0b6e8f4 100644
--- a/indra/newview/llfolderviewmodelinventory.h
+++ b/indra/newview/llfolderviewmodelinventory.h
@@ -48,6 +48,7 @@ public:
virtual bool isItemInTrash( void) const { return false; } // TODO: make into pure virtual.
virtual bool isItemInOutfits() const { return false; }
virtual bool isAgentInventory() const { return false; }
+ virtual bool isAgentInventoryRoot() const { return false; }
virtual bool isUpToDate() const = 0;
virtual void addChild(LLFolderViewModelItem* child);
virtual bool hasChildren() const = 0;
diff --git a/indra/newview/llgltffolderitem.h b/indra/newview/llgltffolderitem.h
index 89d90c81cc..40a4c6fef1 100644
--- a/indra/newview/llgltffolderitem.h
+++ b/indra/newview/llgltffolderitem.h
@@ -114,6 +114,11 @@ public:
EType getType() const { return mItemType; }
S32 getItemId() const { return mItemId; }
+ bool isFavorite() const override { return false; }
+ bool isItemInTrash() const override { return false; }
+ bool isAgentInventory() const override { return false; }
+ bool isAgentInventoryRoot() const override { return false; }
+
private:
LLUIImagePtr pIcon;
std::string mName;
diff --git a/indra/newview/llhudeffectresetskeleton.cpp b/indra/newview/llhudeffectresetskeleton.cpp
new file mode 100644
index 0000000000..31065a3e76
--- /dev/null
+++ b/indra/newview/llhudeffectresetskeleton.cpp
@@ -0,0 +1,211 @@
+/**
+ * @file llhudeffectresetskeleton.cpp
+ * @brief LLHUDEffectResetSkeleton class implementation
+ *
+ * $LicenseInfo:firstyear=2024&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2024, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+
+#include "llhudeffectresetskeleton.h"
+
+#include "llagent.h"
+#include "llviewerobjectlist.h"
+#include "llvoavatar.h"
+#include "message.h"
+
+// packet layout
+const S32 TARGET_OBJECT = 0; // This is to allow for targetting owned animesh
+const S32 RESET_ANIMATIONS = 16; //This can also be a flags if needed
+const S32 PKT_SIZE = 17;
+
+//-----------------------------------------------------------------------------
+// LLHUDEffectResetSkeleton()
+//-----------------------------------------------------------------------------
+LLHUDEffectResetSkeleton::LLHUDEffectResetSkeleton(const U8 type) :
+ LLHUDEffect(type)
+{
+}
+
+//-----------------------------------------------------------------------------
+// ~LLHUDEffectResetSkeleton()
+//-----------------------------------------------------------------------------
+LLHUDEffectResetSkeleton::~LLHUDEffectResetSkeleton()
+{
+}
+
+//-----------------------------------------------------------------------------
+// packData()
+//-----------------------------------------------------------------------------
+void LLHUDEffectResetSkeleton::packData(LLMessageSystem *mesgsys)
+{
+ // Pack the default data
+ LLHUDEffect::packData(mesgsys);
+
+ // Pack the type-specific data. Uses a fun packed binary format. Whee!
+ U8 packed_data[PKT_SIZE];
+ memset(packed_data, 0, PKT_SIZE);
+
+ // pack both target object and position
+ // position interpreted as offset if target object is non-null
+ if (mTargetObject)
+ {
+ htolememcpy(&(packed_data[TARGET_OBJECT]), mTargetObject->mID.mData, MVT_LLUUID, 16);
+ }
+ else
+ {
+ htolememcpy(&(packed_data[TARGET_OBJECT]), LLUUID::null.mData, MVT_LLUUID, 16);
+ }
+
+ U8 resetAnimations = (U8)mResetAnimations;
+ htolememcpy(&(packed_data[RESET_ANIMATIONS]), &resetAnimations, MVT_U8, 1);
+
+ mesgsys->addBinaryDataFast(_PREHASH_TypeData, packed_data, PKT_SIZE);
+}
+
+//-----------------------------------------------------------------------------
+// unpackData()
+//-----------------------------------------------------------------------------
+void LLHUDEffectResetSkeleton::unpackData(LLMessageSystem *mesgsys, S32 blocknum)
+{
+ LLVector3d new_target;
+ U8 packed_data[PKT_SIZE];
+
+
+ LLHUDEffect::unpackData(mesgsys, blocknum);
+
+ LLUUID source_id;
+ mesgsys->getUUIDFast(_PREHASH_Effect, _PREHASH_AgentID, source_id, blocknum);
+
+ LLViewerObject *objp = gObjectList.findObject(source_id);
+ if (objp && objp->isAvatar())
+ {
+ setSourceObject(objp);
+ }
+ else
+ {
+ //LL_WARNS() << "Could not find source avatar for ResetSkeleton effect" << LL_ENDL;
+ return;
+ }
+
+ S32 size = mesgsys->getSizeFast(_PREHASH_Effect, blocknum, _PREHASH_TypeData);
+ if (size != PKT_SIZE)
+ {
+ LL_WARNS() << "ResetSkeleton effect with bad size " << size << LL_ENDL;
+ return;
+ }
+
+ mesgsys->getBinaryDataFast(_PREHASH_Effect, _PREHASH_TypeData, packed_data, PKT_SIZE, blocknum);
+
+ LLUUID target_id;
+ htolememcpy(target_id.mData, &(packed_data[TARGET_OBJECT]), MVT_LLUUID, 16);
+
+ // The purpose for having a target ID is if we want to reset animesh, or
+ // other things in the future.
+ // I implemented this, but due to issues regarding various permission
+ // checks, I scrapped it for now. --Chaser Zaks
+ // See https://github.com/secondlife/viewer/pull/1212 for additional info
+
+ if (target_id.isNull())
+ {
+ target_id = source_id;
+ }
+
+ objp = gObjectList.findObject(target_id);
+
+ if (objp)
+ {
+ setTargetObject(objp);
+ }
+
+ U8 resetAnimations = 0;
+ htolememcpy(&resetAnimations, &(packed_data[RESET_ANIMATIONS]), MVT_U8, 1);
+
+ // Pre-emptively assume this is going to be flags in the future.
+ // It isn't needed now, but this will assure that only bit 1 is set
+ mResetAnimations = resetAnimations & 1;
+
+ update();
+}
+
+//-----------------------------------------------------------------------------
+// setTargetObjectAndOffset()
+//-----------------------------------------------------------------------------
+void LLHUDEffectResetSkeleton::setTargetObject(LLViewerObject *objp)
+{
+ mTargetObject = objp;
+}
+
+
+//-----------------------------------------------------------------------------
+// markDead()
+//-----------------------------------------------------------------------------
+void LLHUDEffectResetSkeleton::markDead()
+{
+ LLHUDEffect::markDead();
+}
+
+void LLHUDEffectResetSkeleton::setSourceObject(LLViewerObject* objectp)
+{
+ // restrict source objects to avatars
+ if (objectp && objectp->isAvatar())
+ {
+ LLHUDEffect::setSourceObject(objectp);
+ }
+}
+
+//-----------------------------------------------------------------------------
+// update()
+//-----------------------------------------------------------------------------
+void LLHUDEffectResetSkeleton::update()
+{
+ // If the target object is dead, set the target object to NULL
+ if (mTargetObject.isNull() || mTargetObject->isDead())
+ {
+ markDead();
+ return;
+ }
+
+ if (mSourceObject.isNull() || mSourceObject->isDead())
+ {
+ markDead();
+ return;
+ }
+
+ if (mTargetObject->isAvatar())
+ {
+ // Only the owner of a avatar can reset their skeleton like this
+ // Also allow reset if we created the effect (Local resetting)
+ if (mSourceObject->getID() == mTargetObject->getID() || getOriginatedHere())
+ {
+ LLVOAvatar* avatar = mTargetObject->asAvatar();
+ avatar->resetSkeleton(mResetAnimations);
+ }
+ }
+ else
+ {
+ LL_WARNS() << mSourceObject->getID() << " attempted to reset skeleton on "
+ << mTargetObject->getID() << ", but it is not a avatar!" << LL_ENDL;
+ }
+
+ markDead();
+}
diff --git a/indra/newview/llhudeffectresetskeleton.h b/indra/newview/llhudeffectresetskeleton.h
new file mode 100644
index 0000000000..39a6137054
--- /dev/null
+++ b/indra/newview/llhudeffectresetskeleton.h
@@ -0,0 +1,59 @@
+/**
+ * @file llhudeffectresetskeleton.h
+ * @brief LLHUDEffectResetSkeleton class definition
+ *
+ * $LicenseInfo:firstyear=2024&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2024, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLHUDEFFECTRESETSKELETON_H
+#define LL_LLHUDEFFECTRESETSKELETON_H
+
+#include "llhudeffect.h"
+
+class LLViewerObject;
+class LLVOAvatar;
+
+
+class LLHUDEffectResetSkeleton final : public LLHUDEffect
+{
+public:
+ friend class LLHUDObject;
+
+ /*virtual*/ void markDead();
+ /*virtual*/ void setSourceObject(LLViewerObject* objectp);
+
+ void setTargetObject(LLViewerObject *objp);
+ void setResetAnimations(bool enable){ mResetAnimations = enable; };
+
+protected:
+ LLHUDEffectResetSkeleton(const U8 type);
+ ~LLHUDEffectResetSkeleton();
+
+ /*virtual*/ void packData(LLMessageSystem *mesgsys);
+ /*virtual*/ void unpackData(LLMessageSystem *mesgsys, S32 blocknum);
+
+ void update();
+private:
+ bool mResetAnimations;
+};
+
+#endif // LL_LLHUDEFFECTRESETSKELETON_H
diff --git a/indra/newview/llhudobject.cpp b/indra/newview/llhudobject.cpp
index e6fbfbfb38..04e9e2dff2 100644
--- a/indra/newview/llhudobject.cpp
+++ b/indra/newview/llhudobject.cpp
@@ -36,6 +36,7 @@
#include "llhudeffecttrail.h"
#include "llhudeffectlookat.h"
#include "llhudeffectpointat.h"
+#include "llhudeffectresetskeleton.h"
#include "llhudnametag.h"
#include "llvoicevisualizer.h"
@@ -241,6 +242,9 @@ LLHUDEffect *LLHUDObject::addHUDEffect(const U8 type)
case LL_HUD_EFFECT_BLOB:
hud_objectp = new LLHUDEffectBlob(type);
break;
+ case LL_HUD_EFFECT_RESET_SKELETON:
+ hud_objectp = new LLHUDEffectResetSkeleton(type);
+ break;
default:
LL_WARNS() << "Unknown type of hud effect:" << (U32) type << LL_ENDL;
}
diff --git a/indra/newview/llhudobject.h b/indra/newview/llhudobject.h
index 8c628e3f92..f683f21e96 100644
--- a/indra/newview/llhudobject.h
+++ b/indra/newview/llhudobject.h
@@ -96,7 +96,8 @@ public:
LL_HUD_EFFECT_POINTAT,
LL_HUD_EFFECT_VOICE_VISUALIZER, // Ventrella
LL_HUD_NAME_TAG,
- LL_HUD_EFFECT_BLOB
+ LL_HUD_EFFECT_BLOB,
+ LL_HUD_EFFECT_RESET_SKELETON
};
protected:
static void sortObjects();
diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp
index 4e8bcc4f7a..4c02511268 100644
--- a/indra/newview/llimprocessing.cpp
+++ b/indra/newview/llimprocessing.cpp
@@ -422,6 +422,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,
U8 *binary_bucket,
S32 binary_bucket_size,
LLHost &sender,
+ LLSD metadata,
LLUUID aux_id)
{
LLChat chat;
@@ -451,6 +452,28 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,
bool is_linden = chat.mSourceType != CHAT_SOURCE_OBJECT &&
LLMuteList::isLinden(name);
+ /***
+ * The simulator may have flagged this sender as a bot, if the viewer would like to display
+ * the chat text in a different color or font, the below code is how the viewer can
+ * tell if the sender is a bot.
+ *-----------------------------------------------------
+ bool is_bot = false;
+ if (metadata.has("sender"))
+ { // The server has identified this sender as a bot.
+ is_bot = metadata["sender"]["bot"].asBoolean();
+ }
+ *-----------------------------------------------------
+ */
+
+ std::string notice_name;
+ LLSD notice_args;
+ if (metadata.has("notice"))
+ { // The server has injected a notice into the IM conversation.
+ // These will be things like bot notifications, etc.
+ notice_name = metadata["notice"]["id"].asString();
+ notice_args = metadata["notice"]["data"];
+ }
+
chat.mMuted = is_muted;
chat.mFromID = from_id;
chat.mFromName = name;
@@ -544,7 +567,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,
}
else
{
- // standard message, not from system
+ // standard message, server may have injected a notice into the conversation.
std::string saved;
if (offline == IM_OFFLINE)
{
@@ -579,8 +602,17 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,
region_message = true;
}
}
- gIMMgr->addMessage(
- session_id,
+
+ std::string real_name;
+
+ if (!notice_name.empty())
+ { // The simulator has injected some sort of notice into the conversation.
+ // findString will only replace the contents of buffer if the notice_id is found.
+ LLTrans::findString(buffer, notice_name, notice_args);
+ real_name = SYSTEM_FROM;
+ }
+
+ gIMMgr->addMessage(session_id,
from_id,
name,
buffer,
@@ -591,7 +623,9 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,
region_id,
position,
region_message,
- timestamp);
+ timestamp,
+ LLUUID::null,
+ real_name);
}
else
{
@@ -1619,6 +1653,12 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url)
from_group = message_data["from_group"].asString() == "Y";
}
+ LLSD metadata;
+ if (message_data.has("metadata"))
+ {
+ metadata = message_data["metadata"];
+ }
+
EInstantMessage dialog = static_cast<EInstantMessage>(message_data["dialog"].asInteger());
LLUUID session_id = message_data["transaction-id"].asUUID();
if (session_id.isNull() && dialog == IM_FROM_TASK)
@@ -1646,6 +1686,7 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url)
local_bin_bucket.data(),
S32(local_bin_bucket.size()),
local_sender,
+ metadata,
message_data["asset_id"].asUUID());
});
diff --git a/indra/newview/llimprocessing.h b/indra/newview/llimprocessing.h
index 030d28b198..66ffc59ae0 100644
--- a/indra/newview/llimprocessing.h
+++ b/indra/newview/llimprocessing.h
@@ -48,6 +48,7 @@ public:
U8 *binary_bucket,
S32 binary_bucket_size,
LLHost &sender,
+ LLSD metadata,
LLUUID aux_id = LLUUID::null);
// Either receives list of offline messages from 'ReadOfflineMsgs' capability
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 756f3b33ed..acabd97d57 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -1691,6 +1691,8 @@ bool LLIMModel::logToFile(const std::string& file_name, const std::string& from,
}
else
{
+ // will check KeepConversationLogTranscripts on its own
+ LLConversationLog::instance().cache();
return false;
}
}
@@ -3144,9 +3146,16 @@ void LLIMMgr::addMessage(
const LLUUID& region_id,
const LLVector3& position,
bool is_region_msg,
- U32 timestamp) // May be zero
+ U32 timestamp, // May be zero
+ LLUUID display_id,
+ std::string_view display_name)
{
LLUUID other_participant_id = target_id;
+ std::string message_display_name = (display_name.empty()) ? from : std::string(display_name);
+ if (display_id.isNull() && (display_name.empty()))
+ {
+ display_id = other_participant_id;
+ }
LLUUID new_session_id = session_id;
if (new_session_id.isNull())
@@ -3243,7 +3252,7 @@ void LLIMMgr::addMessage(
}
//Play sound for new conversations
- if (!skip_message & !gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundNewConversation")))
+ if (!skip_message && !gAgent.isDoNotDisturb() && (gSavedSettings.getBOOL("PlaySoundNewConversation")))
{
make_ui_sound("UISndNewIncomingIMSession");
}
@@ -3257,7 +3266,7 @@ void LLIMMgr::addMessage(
if (!LLMuteList::getInstance()->isMuted(other_participant_id, LLMute::flagTextChat) && !skip_message)
{
- LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, msg, true, is_region_msg, timestamp);
+ LLIMModel::instance().addMessage(new_session_id, message_display_name, display_id, msg, true, is_region_msg, timestamp);
}
// Open conversation floater if offline messages are present
diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h
index 61776860e3..23f90ca795 100644
--- a/indra/newview/llimview.h
+++ b/indra/newview/llimview.h
@@ -368,7 +368,9 @@ public:
const LLUUID& region_id = LLUUID::null,
const LLVector3& position = LLVector3::zero,
bool is_region_msg = false,
- U32 timestamp = 0);
+ U32 timestamp = 0,
+ LLUUID display_id = LLUUID::null,
+ std::string_view display_name = "");
void addSystemMessage(const LLUUID& session_id, const std::string& message_name, const LLSD& args);
diff --git a/indra/newview/llinspecttexture.cpp b/indra/newview/llinspecttexture.cpp
index 24dbe61bad..9f0d236826 100644
--- a/indra/newview/llinspecttexture.cpp
+++ b/indra/newview/llinspecttexture.cpp
@@ -115,7 +115,6 @@ public:
protected:
LLPointer<LLViewerFetchedTexture> m_Image;
- S32 mImageBoostLevel = LLGLTexture::BOOST_NONE;
std::string mLoadingText;
};
@@ -128,12 +127,8 @@ LLTexturePreviewView::LLTexturePreviewView(const LLView::Params& p)
LLTexturePreviewView::~LLTexturePreviewView()
{
- if (m_Image)
- {
- m_Image->setBoostLevel(mImageBoostLevel);
m_Image = nullptr;
}
-}
void LLTexturePreviewView::draw()
{
@@ -153,18 +148,18 @@ void LLTexturePreviewView::draw()
bool isLoading = (!m_Image->isFullyLoaded()) && (m_Image->getDiscardLevel() > 0);
if (isLoading)
LLFontGL::getFontSansSerif()->renderUTF8(mLoadingText, 0, rctClient.mLeft + 3, rctClient.mTop - 25, LLColor4::white, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::DROP_SHADOW);
- m_Image->addTextureStats((isLoading) ? MAX_IMAGE_AREA : (F32)(rctClient.getWidth() * rctClient.getHeight()));
+
+ m_Image->setKnownDrawSize(MAX_IMAGE_SIZE, MAX_IMAGE_SIZE);
}
}
void LLTexturePreviewView::setImageFromAssetId(const LLUUID& idAsset)
{
- m_Image = LLViewerTextureManager::getFetchedTexture(idAsset, FTT_DEFAULT, MIPMAP_TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
+ m_Image = LLViewerTextureManager::getFetchedTexture(idAsset, FTT_DEFAULT, MIPMAP_TRUE, LLGLTexture::BOOST_THUMBNAIL);
if (m_Image)
{
- mImageBoostLevel = m_Image->getBoostLevel();
- m_Image->setBoostLevel(LLGLTexture::BOOST_PREVIEW);
m_Image->forceToSaveRawImage(0);
+ m_Image->setKnownDrawSize(MAX_IMAGE_SIZE, MAX_IMAGE_SIZE);
if ( (!m_Image->isFullyLoaded()) && (!m_Image->hasFetcher()) )
{
if (m_Image->isInFastCacheList())
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 15190854a2..7710cda45b 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -830,6 +830,8 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
{
const LLInventoryObject *obj = getInventoryObject();
bool single_folder_root = (mRoot == NULL);
+ bool is_cof = isCOFFolder();
+ bool is_inbox = isInboxFolder();
if (obj)
{
@@ -844,7 +846,8 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
disabled_items.push_back(std::string("Copy"));
}
- if (isAgentInventory() && !single_folder_root && !isMarketplaceListingsFolder())
+ bool is_agent_inventory = isAgentInventory();
+ if (is_agent_inventory && !single_folder_root && !is_cof && !is_inbox)
{
items.push_back(std::string("New folder from selected"));
items.push_back(std::string("Subfolder Separator"));
@@ -857,6 +860,19 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
}
}
+ if (isFavorite())
+ {
+ items.push_back(std::string("Remove from Favorites"));
+ }
+ else if (is_agent_inventory && !gInventory.isObjectDescendentOf(mUUID, gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH)))
+ {
+ items.push_back(std::string("Add to Favorites"));
+ if (gInventory.getRootFolderID() == mUUID)
+ {
+ disabled_items.push_back(std::string("Add to Favorites"));
+ }
+ }
+
if (obj->getIsLinkType())
{
items.push_back(std::string("Find Original"));
@@ -869,6 +885,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
if (!isItemMovable() || !canMenuCut())
{
disabled_items.push_back(std::string("Cut"));
+ disabled_items.push_back(std::string("New folder from selected"));
}
}
else
@@ -878,7 +895,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
items.push_back(std::string("Find Links"));
}
- if (!isInboxFolder() && !single_folder_root)
+ if (!is_inbox && !single_folder_root)
{
items.push_back(std::string("Rename"));
if (!isItemRenameable() || ((flags & FIRST_SELECTED_ITEM) == 0))
@@ -918,6 +935,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
if (!isItemMovable() || !canMenuCut())
{
disabled_items.push_back(std::string("Cut"));
+ disabled_items.push_back(std::string("New folder from selected"));
}
if (canListOnMarketplace() && !isMarketplaceListingsFolder() && !isInboxFolder())
@@ -940,7 +958,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
}
// Don't allow items to be pasted directly into the COF or the inbox
- if (!isCOFFolder() && !isInboxFolder())
+ if (!is_cof && !is_inbox)
{
items.push_back(std::string("Paste"));
}
@@ -1334,6 +1352,13 @@ bool LLInvFVBridge::isAgentInventory() const
return model->isObjectDescendentOf(mUUID, gInventory.getRootFolderID());
}
+bool LLInvFVBridge::isAgentInventoryRoot() const
+{
+ const LLInventoryModel* model = getInventoryModel();
+ if(!model) return false;
+ return gInventory.getRootFolderID() == mUUID;
+}
+
bool LLInvFVBridge::isCOFFolder() const
{
return LLAppearanceMgr::instance().getIsInCOF(mUUID);
@@ -2281,7 +2306,21 @@ const LLUUID& LLItemBridge::getThumbnailUUID() const
return LLUUID::null;
}
-// virtual
+bool LLItemBridge::isFavorite() const
+{
+ LLViewerInventoryItem* item = NULL;
+ LLInventoryModel* model = getInventoryModel();
+ if (model)
+ {
+ item = model->getItem(mUUID);
+ }
+ if (item)
+ {
+ return get_is_favorite(item);
+ }
+ return false;
+}
+
bool LLItemBridge::isItemPermissive() const
{
if (LLViewerInventoryItem* item = getItem())
@@ -2426,6 +2465,16 @@ const LLUUID& LLFolderBridge::getThumbnailUUID() const
return LLUUID::null;
}
+bool LLFolderBridge::isFavorite() const
+{
+ LLViewerInventoryCategory* cat = getCategory();
+ if (cat)
+ {
+ return cat->getIsFavorite();
+ }
+ return false;
+}
+
void LLFolderBridge::update()
{
// we know we have children but haven't fetched them (doesn't obey filter)
@@ -4274,6 +4323,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items
}
disabled_items.push_back(std::string("New Folder"));
+ disabled_items.push_back(std::string("upload_options"));
disabled_items.push_back(std::string("upload_def"));
disabled_items.push_back(std::string("create_new"));
}
@@ -4299,6 +4349,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items
{
disabled_items.push_back(std::string("New Folder"));
disabled_items.push_back(std::string("New Listing Folder"));
+ disabled_items.push_back(std::string("upload_options"));
disabled_items.push_back(std::string("upload_def"));
disabled_items.push_back(std::string("create_new"));
}
@@ -4365,6 +4416,7 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items
}
if (!isMarketplaceListingsFolder())
{
+ items.push_back(std::string("upload_options"));
items.push_back(std::string("upload_def"));
items.push_back(std::string("create_new"));
items.push_back(std::string("New Script"));
@@ -4398,6 +4450,15 @@ void LLFolderBridge::buildContextMenuOptions(U32 flags, menuentry_vec_t& items
items.push_back(std::string("Rename"));
items.push_back(std::string("thumbnail"));
+ if (cat->getIsFavorite())
+ {
+ items.push_back(std::string("Remove from Favorites"));
+ }
+ else
+ {
+ items.push_back(std::string("Add to Favorites"));
+ }
+
addDeleteContextMenuOptions(items, disabled_items);
// EXT-4030: disallow deletion of currently worn outfit
const LLViewerInventoryItem *base_outfit_link = LLAppearanceMgr::instance().getBaseOutfitLink();
@@ -6909,12 +6970,13 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action)
item = (LLViewerInventoryItem*)gInventory.getItem(object_id);
if(item && gInventory.isObjectDescendentOf(object_id, gInventory.getRootFolderID()))
{
- rez_attachment(item, NULL, true); // Replace if "Wear"ing.
+ static LLCachedControl<bool> replace_item(gSavedSettings, "InventoryAddAttachmentBehavior", false);
+ rez_attachment(item, NULL, ("attach" == action) ? replace_item() : true); // Replace if "Wear"ing.
}
else if(item && item->isFinished())
{
// must be in library. copy it to our inventory and put it on.
- LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, (LLViewerJointAttachment*)0));
+ LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, (LLViewerJointAttachment*)0, true));
copy_inventory_item(
gAgent.getID(),
item->getPermissions().getOwner(),
@@ -8039,7 +8101,8 @@ void LLObjectBridgeAction::attachOrDetach()
}
else
{
- LLAppearanceMgr::instance().wearItemOnAvatar(mUUID, true, false); // Don't replace if adding.
+ static LLCachedControl<bool> inventory_linking(gSavedSettings, "InventoryAddAttachmentBehavior", false);
+ LLAppearanceMgr::instance().wearItemOnAvatar(mUUID, true, inventory_linking()); // Don't replace if adding.
}
}
@@ -8230,6 +8293,7 @@ void LLRecentItemsFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
buildContextMenuOptions(flags, items, disabled_items);
items.erase(std::remove(items.begin(), items.end(), std::string("New Folder")), items.end());
+ items.erase(std::remove(items.begin(), items.end(), std::string("New folder from selected")), items.end());
hide_context_entries(menu, items, disabled_items);
}
@@ -8264,6 +8328,51 @@ LLInvFVBridge* LLRecentInventoryBridgeBuilder::createBridge(
return new_listener;
}
+/************************************************************************/
+/* Favorites Inventory Panel related classes */
+/************************************************************************/
+void LLFavoritesFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
+{
+ // todo: consider things that should be disabled
+ menuentry_vec_t disabled_items, items;
+ buildContextMenuOptions(flags, items, disabled_items);
+
+ items.erase(std::remove(items.begin(), items.end(), std::string("New Folder")), items.end());
+ items.erase(std::remove(items.begin(), items.end(), std::string("New folder from selected")), items.end());
+
+ hide_context_entries(menu, items, disabled_items);
+}
+
+LLInvFVBridge* LLFavoritesInventoryBridgeBuilder::createBridge(
+ LLAssetType::EType asset_type,
+ LLAssetType::EType actual_asset_type,
+ LLInventoryType::EType inv_type,
+ LLInventoryPanel* inventory,
+ LLFolderViewModelInventory* view_model,
+ LLFolderView* root,
+ const LLUUID& uuid,
+ U32 flags /*= 0x00*/) const
+{
+ LLInvFVBridge* new_listener = NULL;
+ if (asset_type == LLAssetType::AT_CATEGORY
+ && actual_asset_type != LLAssetType::AT_LINK_FOLDER)
+ {
+ new_listener = new LLFavoritesFolderBridge(inv_type, inventory, root, uuid);
+ }
+ else
+ {
+ new_listener = LLInventoryFolderViewModelBuilder::createBridge(asset_type,
+ actual_asset_type,
+ inv_type,
+ inventory,
+ view_model,
+ root,
+ uuid,
+ flags);
+ }
+ return new_listener;
+}
+
LLFolderViewGroupedItemBridge::LLFolderViewGroupedItemBridge()
{
}
@@ -8274,7 +8383,7 @@ void LLFolderViewGroupedItemBridge::groupFilterContextMenu(folder_view_item_dequ
menuentry_vec_t disabled_items;
if (get_selection_item_uuids(selected_items, ids))
{
- if (!LLAppearanceMgr::instance().canAddWearables(ids) && canWearSelected(ids))
+ if (!LLAppearanceMgr::instance().canAddWearables(ids, false) && canWearSelected(ids))
{
disabled_items.push_back(std::string("Wearable And Object Wear"));
disabled_items.push_back(std::string("Wearable Add"));
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index 3e7f74384b..1b80ac163c 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -86,6 +86,7 @@ public:
//--------------------------------------------------------------------
virtual const LLUUID& getUUID() const { return mUUID; }
virtual const LLUUID& getThumbnailUUID() const { return LLUUID::null; }
+ virtual bool isFavorite() const { return false; }
virtual void clearDisplayName() { mDisplayName.clear(); }
virtual void restoreItem() {}
virtual void restoreToWorld() {}
@@ -175,6 +176,7 @@ protected:
bool isLinkedObjectMissing() const; // Is this a linked obj whose baseobj is not in inventory?
bool isAgentInventory() const; // false if lost or in the inventory library
+ bool isAgentInventoryRoot() const; // true if worn by agent
bool isCOFFolder() const; // true if COF or descendant of
bool isInboxFolder() const; // true if COF or descendant of marketplace inbox
@@ -259,6 +261,7 @@ public:
LLViewerInventoryItem* getItem() const;
virtual const LLUUID& getThumbnailUUID() const;
+ virtual bool isFavorite() const;
protected:
bool confirmRemoveItem(const LLSD& notification, const LLSD& response);
@@ -301,6 +304,7 @@ public:
virtual std::string getLabelSuffix() const;
virtual LLFontGL::StyleFlags getLabelStyle() const;
virtual const LLUUID& getThumbnailUUID() const;
+ virtual bool isFavorite() const;
void setShowDescendantsCount(bool show_count) {mShowDescendantsCount = show_count;}
@@ -754,6 +758,45 @@ public:
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// Favorites Inventory Panel related classes
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+// Overridden version of the Inventory-Folder-View-Bridge for Folders
+class LLFavoritesFolderBridge : public LLFolderBridge
+{
+ friend class LLInvFVBridgeAction;
+public:
+ // Creates context menu for Folders related to Recent Inventory Panel.
+ // Uses base logic and than removes from visible items "New..." menu items.
+ LLFavoritesFolderBridge(LLInventoryType::EType type,
+ LLInventoryPanel* inventory,
+ LLFolderView* root,
+ const LLUUID& uuid) :
+ LLFolderBridge(inventory, root, uuid)
+ {
+ mInvType = type;
+ }
+ /*virtual*/ void buildContextMenu(LLMenuGL& menu, U32 flags);
+};
+
+// Bridge builder to create Inventory-Folder-View-Bridge for Recent Inventory Panel
+class LLFavoritesInventoryBridgeBuilder : public LLInventoryFolderViewModelBuilder
+{
+public:
+ LLFavoritesInventoryBridgeBuilder() {}
+ // Overrides FolderBridge for Recent Inventory Panel.
+ // It use base functionality for bridges other than FolderBridge.
+ virtual LLInvFVBridge* createBridge(LLAssetType::EType asset_type,
+ LLAssetType::EType actual_asset_type,
+ LLInventoryType::EType inv_type,
+ LLInventoryPanel* inventory,
+ LLFolderViewModelInventory* view_model,
+ LLFolderView* root,
+ const LLUUID& uuid,
+ U32 flags = 0x00) const;
+};
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Marketplace Inventory Panel related classes
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -780,7 +823,7 @@ private:
void rez_attachment(LLViewerInventoryItem* item,
LLViewerJointAttachment* attachment,
- bool replace = false);
+ bool replace);
// Move items from an in-world object's "Contents" folder to a specified
// folder in agent inventory.
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 5c0905af3c..6c5421596b 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -64,6 +64,7 @@ LLInventoryFilter::FilterOps::FilterOps(const Params& p)
mFilterUUID(p.uuid),
mFilterLinks(p.links),
mFilterThumbnails(p.thumbnails),
+ mFilterFavorites(p.favorites),
mSearchVisibility(p.search_visibility)
{
}
@@ -159,6 +160,7 @@ bool LLInventoryFilter::check(const LLFolderViewModelItem* item)
passed = passed && checkAgainstCreator(listener);
passed = passed && checkAgainstSearchVisibility(listener);
+ passed = passed && checkAgainstFilterFavorites(listener->getUUID());
passed = passed && checkAgainstFilterThumbnails(listener->getUUID());
return passed;
@@ -221,6 +223,19 @@ bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const
return false;
}
+ const LLViewerInventoryCategory* cat = gInventory.getCategory(folder_id);
+ if (cat && cat->getIsFavorite())
+ {
+ if (mFilterOps.mFilterFavorites == FILTER_ONLY_FAVORITES)
+ {
+ return true;
+ }
+ if (mFilterOps.mFilterFavorites == FILTER_EXCLUDE_FAVORITES)
+ {
+ return false;
+ }
+ }
+
// Marketplace folder filtering
const U32 filterTypes = mFilterOps.mFilterTypes;
const U32 marketplace_filter = FILTERTYPE_MARKETPLACE_ACTIVE | FILTERTYPE_MARKETPLACE_INACTIVE |
@@ -273,6 +288,16 @@ bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const
}
}
+ if (filterTypes & FILTERTYPE_NO_TRASH_ITEMS)
+ {
+ const LLUUID trash_uuid = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
+ // If not a descendant of the marketplace listings root, then the nesting depth is -1 by definition
+ if (gInventory.isObjectDescendentOf(folder_id, trash_uuid))
+ {
+ return false;
+ }
+ }
+
// show folder links
LLViewerInventoryItem* item = gInventory.getItem(folder_id);
if (item && item->getActualType() == LLAssetType::AT_LINK_FOLDER)
@@ -611,6 +636,24 @@ bool LLInventoryFilter::checkAgainstFilterThumbnails(const LLUUID& object_id) co
return true;
}
+bool LLInventoryFilter::checkAgainstFilterFavorites(const LLUUID& object_id) const
+{
+ const LLInventoryObject* object = gInventory.getObject(object_id);
+ if (!object) return true;
+
+
+ if (mFilterOps.mFilterFavorites != FILTER_INCLUDE_FAVORITES)
+ {
+ bool is_favorite = get_is_favorite(object);
+ if (is_favorite && (mFilterOps.mFilterFavorites == FILTER_EXCLUDE_FAVORITES))
+ return false;
+ if (!is_favorite && (mFilterOps.mFilterFavorites == FILTER_ONLY_FAVORITES))
+ return false;
+ }
+
+ return true;
+}
+
bool LLInventoryFilter::checkAgainstCreator(const LLFolderViewModelItemInventory* listener) const
{
if (!listener)
@@ -811,6 +854,32 @@ void LLInventoryFilter::setFilterThumbnails(U64 filter_thumbnails)
mFilterOps.mFilterThumbnails = filter_thumbnails;
}
+void LLInventoryFilter::setFilterFavorites(U64 filter_favorites)
+{
+ if (mFilterOps.mFilterFavorites != filter_favorites)
+ {
+ if (mFilterOps.mFilterFavorites == FILTER_EXCLUDE_FAVORITES
+ && filter_favorites == FILTER_ONLY_FAVORITES)
+ {
+ setModified(FILTER_RESTART);
+ }
+ else if (mFilterOps.mFilterFavorites == FILTER_ONLY_FAVORITES
+ && filter_favorites == FILTER_EXCLUDE_FAVORITES)
+ {
+ setModified(FILTER_RESTART);
+ }
+ else if (mFilterOps.mFilterFavorites == FILTER_INCLUDE_FAVORITES)
+ {
+ setModified(FILTER_MORE_RESTRICTIVE);
+ }
+ else
+ {
+ setModified(FILTER_LESS_RESTRICTIVE);
+ }
+ }
+ mFilterOps.mFilterFavorites = filter_favorites;
+}
+
void LLInventoryFilter::setFilterEmptySystemFolders()
{
mFilterOps.mFilterTypes |= FILTERTYPE_EMPTYFOLDERS;
@@ -923,6 +992,11 @@ void LLInventoryFilter::toggleSearchVisibilityLibrary()
}
}
+void LLInventoryFilter::setFilterNoTrashFolder()
+{
+ mFilterOps.mFilterTypes |= FILTERTYPE_NO_TRASH_ITEMS;
+}
+
void LLInventoryFilter::setFilterNoMarketplaceFolder()
{
mFilterOps.mFilterTypes |= FILTERTYPE_NO_MARKETPLACE_ITEMS;
@@ -1615,6 +1689,11 @@ U64 LLInventoryFilter::getFilterThumbnails() const
return mFilterOps.mFilterThumbnails;
}
+U64 LLInventoryFilter::getFilterFavorites() const
+{
+ return mFilterOps.mFilterFavorites;
+}
+
bool LLInventoryFilter::hasFilterString() const
{
return mFilterSubString.size() > 0;
diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h
index 7e64a03e73..2bdc646084 100644
--- a/indra/newview/llinventoryfilter.h
+++ b/indra/newview/llinventoryfilter.h
@@ -61,6 +61,7 @@ public:
FILTERTYPE_NO_MARKETPLACE_ITEMS = 0x1 << 10, // pass iff folder is not under the marketplace
FILTERTYPE_WORN = 0x1 << 11, // pass if item is worn
FILTERTYPE_SETTINGS = 0x1 << 12, // pass if the item is a settings object
+ FILTERTYPE_NO_TRASH_ITEMS = 0x1 << 13, // pass iff folder is not under the marketplace
};
enum EFilterDateDirection
@@ -83,6 +84,13 @@ public:
FILTER_ONLY_THUMBNAILS
};
+ enum EFilterFavorite
+ {
+ FILTER_INCLUDE_FAVORITES,
+ FILTER_EXCLUDE_FAVORITES,
+ FILTER_ONLY_FAVORITES
+ };
+
enum ESortOrderType
{
SO_NAME = 0, // Sort inventory by name
@@ -149,6 +157,7 @@ public:
Optional<PermissionMask> permissions;
Optional<EFilterCreatorType> creator_type;
Optional<EFilterThumbnail> thumbnails;
+ Optional<EFilterFavorite> favorites;
Params()
: types("filter_types", FILTERTYPE_OBJECT),
@@ -156,6 +165,7 @@ public:
wearable_types("wearable_types", 0xffffFFFFffffFFFFULL),
settings_types("settings_types", 0xffffFFFFffffFFFFULL),
thumbnails("thumbnails", FILTER_INCLUDE_THUMBNAILS),
+ favorites("favorites", FILTER_INCLUDE_FAVORITES),
category_types("category_types", 0xffffFFFFffffFFFFULL),
links("links", FILTERLINK_INCLUDE_LINKS),
search_visibility("search_visibility", 0xFFFFFFFF),
@@ -177,6 +187,7 @@ public:
mFilterWearableTypes,
mFilterSettingsTypes, // for _SETTINGS
mFilterThumbnails,
+ mFilterFavorites,
mFilterLinks,
mFilterCategoryTypes; // For _CATEGORY
LLUUID mFilterUUID; // for UUID
@@ -220,6 +231,7 @@ public:
U64 getFilterSettingsTypes() const;
U64 getSearchVisibilityTypes() const;
U64 getFilterThumbnails() const;
+ U64 getFilterFavorites() const;
bool isFilterObjectTypesWith(LLInventoryType::EType t) const;
void setFilterObjectTypes(U64 types);
@@ -233,8 +245,10 @@ public:
void setFilterMarketplaceInactiveFolders();
void setFilterMarketplaceUnassociatedFolders();
void setFilterMarketplaceListingFolders(bool select_only_listing_folders);
+ void setFilterNoTrashFolder();
void setFilterNoMarketplaceFolder();
void setFilterThumbnails(U64 filter_thumbnails);
+ void setFilterFavorites(U64 filter_favorites);
void updateFilterTypes(U64 types, U64& current_types);
void setSearchType(ESearchType type);
ESearchType getSearchType() { return mSearchType; }
@@ -339,6 +353,7 @@ public:
LLInventoryFilter& operator =(const LLInventoryFilter& other);
bool checkAgainstFilterThumbnails(const LLUUID& object_id) const;
+ bool checkAgainstFilterFavorites(const LLUUID& object_id) const;
private:
bool areDateLimitsSet();
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 1ccefa3212..a2626daa2e 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -51,6 +51,7 @@
#include "lldirpicker.h"
#include "lldonotdisturbnotificationstorage.h"
#include "llfloatermarketplacelistings.h"
+#include "llfloatermodelpreview.h"
#include "llfloatersidepanelcontainer.h"
#include "llfocusmgr.h"
#include "llfolderview.h"
@@ -62,6 +63,7 @@
#include "llinventorymodel.h"
#include "llinventorypanel.h"
#include "lllineeditor.h"
+#include "llmaterialeditor.h"
#include "llmarketplacenotifications.h"
#include "llmarketplacefunctions.h"
#include "llmenugl.h"
@@ -86,6 +88,7 @@
#include "llviewermessage.h"
#include "llviewerfoldertype.h"
#include "llviewerobjectlist.h"
+#include "llviewermenufile.h"
#include "llviewerregion.h"
#include "llviewerwindow.h"
#include "llvoavatarself.h"
@@ -2147,21 +2150,10 @@ void validate_marketplacelistings(
void change_item_parent(const LLUUID& item_id, const LLUUID& new_parent_id)
{
- LLInventoryItem* inv_item = gInventory.getItem(item_id);
+ LLViewerInventoryItem* inv_item = gInventory.getItem(item_id);
if (inv_item)
{
- LLInventoryModel::update_list_t update;
- LLInventoryModel::LLCategoryUpdate old_folder(inv_item->getParentUUID(), -1);
- update.push_back(old_folder);
- LLInventoryModel::LLCategoryUpdate new_folder(new_parent_id, 1);
- update.push_back(new_folder);
- gInventory.accountForUpdate(update);
-
- LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(inv_item);
- new_item->setParent(new_parent_id);
- new_item->updateParentOnServer(false);
- gInventory.updateItem(new_item);
- gInventory.notifyObservers();
+ gInventory.changeItemParent(inv_item, new_parent_id, false);
}
}
@@ -2169,17 +2161,17 @@ void move_items_to_folder(const LLUUID& new_cat_uuid, const uuid_vec_t& selected
{
for (uuid_vec_t::const_iterator it = selected_uuids.begin(); it != selected_uuids.end(); ++it)
{
- LLInventoryItem* inv_item = gInventory.getItem(*it);
+ LLViewerInventoryItem* inv_item = gInventory.getItem(*it);
if (inv_item)
{
- change_item_parent(*it, new_cat_uuid);
+ gInventory.changeItemParent(inv_item, new_cat_uuid, false);
}
else
{
- LLInventoryCategory* inv_cat = gInventory.getCategory(*it);
+ LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it);
if (inv_cat && !LLFolderType::lookupIsProtectedType(inv_cat->getPreferredType()))
{
- gInventory.changeCategoryParent((LLViewerInventoryCategory*)inv_cat, new_cat_uuid, false);
+ gInventory.changeCategoryParent(inv_cat, new_cat_uuid, false);
}
}
}
@@ -2418,6 +2410,143 @@ void ungroup_folder_items(const LLUUID& folder_id)
gInventory.notifyObservers();
}
+class LLUpdateFavorite : public LLInventoryCallback
+{
+public:
+ LLUpdateFavorite(const LLUUID& inv_item_id)
+ : mInvItemID(inv_item_id)
+ {}
+ /* virtual */ void fire(const LLUUID& inv_item_id) override
+ {
+ gInventory.addChangedMask(LLInventoryObserver::UPDATE_FAVORITE, mInvItemID);
+
+ LLInventoryModel::item_array_t items;
+ LLInventoryModel::cat_array_t cat_array;
+ LLLinkedItemIDMatches matches(mInvItemID);
+ gInventory.collectDescendentsIf(gInventory.getRootFolderID(),
+ cat_array,
+ items,
+ LLInventoryModel::INCLUDE_TRASH,
+ matches);
+
+ std::set<LLUUID> link_ids;
+ for (LLInventoryModel::item_array_t::iterator it = items.begin(); it != items.end(); ++it)
+ {
+ LLPointer<LLViewerInventoryItem> item = *it;
+
+ gInventory.addChangedMask(LLInventoryObserver::UPDATE_FAVORITE, item->getUUID());
+ }
+
+ gInventory.notifyObservers();
+ }
+private:
+ LLUUID mInvItemID;
+};
+
+void favorite_send(LLInventoryObject* obj, const LLUUID& obj_id, bool favorite)
+{
+ LLSD updates;
+ if (favorite)
+ {
+ updates["favorite"] = LLSD().with("toggled", true);
+ }
+ else
+ {
+ updates["favorite"] = LLSD();
+ }
+
+ LLPointer<LLInventoryCallback> cb = new LLUpdateFavorite(obj_id);
+
+ LLViewerInventoryCategory* view_folder = dynamic_cast<LLViewerInventoryCategory*>(obj);
+ if (view_folder)
+ {
+ update_inventory_category(obj_id, updates, cb);
+ }
+ LLViewerInventoryItem* view_item = dynamic_cast<LLViewerInventoryItem*>(obj);
+ if (view_item)
+ {
+ update_inventory_item(obj_id, updates, cb);
+ }
+}
+
+bool get_is_favorite(const LLInventoryObject* object)
+{
+ if (object->getIsLinkType())
+ {
+ LLInventoryObject* obj = gInventory.getObject(object->getLinkedUUID());
+ return obj && obj->getIsFavorite();
+ }
+
+ return object->getIsFavorite();
+}
+
+bool get_is_favorite(const LLUUID& obj_id)
+{
+ LLInventoryObject* object = gInventory.getObject(obj_id);
+ if (object && object->getIsLinkType())
+ {
+ LLInventoryObject* obj = gInventory.getObject(object->getLinkedUUID());
+ return obj && obj->getIsFavorite();
+ }
+
+ return object->getIsFavorite();
+}
+
+void set_favorite(const LLUUID& obj_id, bool favorite)
+{
+ LLInventoryObject* obj = gInventory.getObject(obj_id);
+
+ if (obj && obj->getIsLinkType())
+ {
+ if (!favorite && obj->getIsFavorite())
+ {
+ // Links currently aren't supposed to be favorites,
+ // instead should show state of the original
+ LL_INFOS("Inventory") << "Recovering proper 'favorites' state of a link " << obj_id << LL_ENDL;
+ favorite_send(obj, obj_id, false);
+ }
+ obj = gInventory.getObject(obj->getLinkedUUID());
+ }
+
+ if (obj && obj->getIsFavorite() != favorite)
+ {
+ favorite_send(obj, obj->getUUID(), favorite);
+ }
+}
+
+void toggle_favorite(const LLUUID& obj_id)
+{
+ LLInventoryObject* obj = gInventory.getObject(obj_id);
+ if (obj && obj->getIsLinkType())
+ {
+ obj = gInventory.getObject(obj->getLinkedUUID());
+ }
+
+ if (obj)
+ {
+ favorite_send(obj, obj->getUUID(), !obj->getIsFavorite());
+ }
+}
+
+void toggle_favorites(const uuid_vec_t& ids)
+{
+ if (ids.size() == 0)
+ {
+ return;
+ }
+ if (ids.size() == 1)
+ {
+ toggle_favorite(ids[0]);
+ return;
+ }
+
+ bool new_val = !get_is_favorite(ids.front());
+ for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it)
+ {
+ set_favorite(*it, new_val);
+ }
+}
+
std::string get_searchable_description(LLInventoryModel* model, const LLUUID& item_id)
{
if (model)
@@ -2713,6 +2842,20 @@ bool LLIsTypeWithPermissions::operator()(LLInventoryCategory* cat, LLInventoryIt
return false;
}
+bool LLFavoritesCollector::operator()(LLInventoryCategory* cat,
+ LLInventoryItem* item)
+{
+ if (item && item->getIsFavorite())
+ {
+ return true;
+ }
+ if (cat && cat->getIsFavorite())
+ {
+ return true;
+ }
+ return false;
+}
+
bool LLBuddyCollector::operator()(LLInventoryCategory* cat,
LLInventoryItem* item)
{
@@ -3197,7 +3340,7 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root
for (LLInventoryModel::item_array_t::value_type& item : items)
{
- if (get_is_item_worn(item))
+ if (!item->getIsLinkType() && get_is_item_worn(item))
{
has_worn = true;
LLWearableType::EType type = item->getWearableType();
@@ -3217,7 +3360,7 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root
}
}
LLViewerInventoryItem* item = gInventory.getItem(obj_id);
- if (item && get_is_item_worn(item))
+ if (item && !item->getIsLinkType() && get_is_item_worn(item))
{
has_worn = true;
LLWearableType::EType type = item->getWearableType();
@@ -3423,7 +3566,6 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root
}
else if ("new_folder_from_selected" == action)
{
-
LLInventoryObject* first_item = gInventory.getObject(*ids.begin());
if (!first_item)
{
@@ -3467,6 +3609,20 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root
ungroup_folder_items(*ids.begin());
}
}
+ else if ("add_to_favorites" == action)
+ {
+ for (const LLUUID& id : ids)
+ {
+ set_favorite(id, true);
+ }
+ }
+ else if ("remove_from_favorites" == action)
+ {
+ for (const LLUUID& id : ids)
+ {
+ set_favorite(id, false);
+ }
+ }
else if ("thumbnail" == action)
{
if (selected_items.size() > 0)
@@ -3577,6 +3733,54 @@ void LLInventoryAction::removeItemFromDND(LLFolderView* root)
}
}
+void LLInventoryAction::fileUploadLocation(const LLUUID& dest_id, const std::string& action)
+{
+ if (action == "def_model")
+ {
+ gSavedPerAccountSettings.setString("ModelUploadFolder", dest_id.asString());
+ }
+ else if (action == "def_texture")
+ {
+ gSavedPerAccountSettings.setString("TextureUploadFolder", dest_id.asString());
+ }
+ else if (action == "def_sound")
+ {
+ gSavedPerAccountSettings.setString("SoundUploadFolder", dest_id.asString());
+ }
+ else if (action == "def_animation")
+ {
+ gSavedPerAccountSettings.setString("AnimationUploadFolder", dest_id.asString());
+ }
+ else if (action == "def_pbr_material")
+ {
+ gSavedPerAccountSettings.setString("PBRUploadFolder", dest_id.asString());
+ }
+ else if (action == "upload_texture")
+ {
+ LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2, dest_id), LLFilePicker::FFLOAD_IMAGE, false);
+ }
+ else if (action == "upload_sound")
+ {
+ LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2, dest_id), LLFilePicker::FFLOAD_WAV, false);
+ }
+ else if (action == "upload_animation")
+ {
+ LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2, dest_id), LLFilePicker::FFLOAD_ANIM, false);
+ }
+ else if (action == "upload_model")
+ {
+ LLFloaterModelPreview::showModelPreview(dest_id);
+ }
+ else if (action == "upload_pbr_material")
+ {
+ LLMaterialEditor::importMaterial(dest_id);
+ }
+ else if (action == "upload_bulk")
+ {
+ LLFilePickerReplyThread::startPicker(boost::bind(&upload_bulk, _1, _2, true, dest_id), LLFilePicker::FFLOAD_ALL, true);
+ }
+}
+
void LLInventoryAction::onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response, LLHandle<LLFolderView> root)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h
index 13a64f21dc..a668cc31d8 100644
--- a/indra/newview/llinventoryfunctions.h
+++ b/indra/newview/llinventoryfunctions.h
@@ -116,6 +116,11 @@ bool can_move_to_my_outfits(LLInventoryModel* model, LLInventoryCategory* inv_ca
std::string get_localized_folder_name(LLUUID cat_uuid);
void new_folder_window(const LLUUID& folder_id);
void ungroup_folder_items(const LLUUID& folder_id);
+bool get_is_favorite(const LLInventoryObject* object);
+bool get_is_favorite(const LLUUID& obj_id);
+void set_favorite(const LLUUID& obj_id, bool favorite);
+void toggle_favorite(const LLUUID& obj_id);
+void toggle_favorites(const uuid_vec_t& ids);
std::string get_searchable_description(LLInventoryModel* model, const LLUUID& item_id);
std::string get_searchable_creator_name(LLInventoryModel* model, const LLUUID& item_id);
std::string get_searchable_UUID(LLInventoryModel* model, const LLUUID& item_id);
@@ -344,6 +349,18 @@ protected:
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// Class LLFavoritesCollector
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+class LLFavoritesCollector : public LLInventoryCollectFunctor
+{
+public:
+ LLFavoritesCollector() {}
+ virtual ~LLFavoritesCollector() {}
+ virtual bool operator()(LLInventoryCategory* cat,
+ LLInventoryItem* item);
+};
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLBuddyCollector
//
// Simple class that collects calling cards that are not null, and not
@@ -601,6 +618,7 @@ struct LLInventoryAction
static void callback_copySelected(const LLSD& notification, const LLSD& response, class LLInventoryModel* model, class LLFolderView* root, const std::string& action);
static void onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response, LLHandle<LLFolderView> root);
static void removeItemFromDND(LLFolderView* root);
+ static void fileUploadLocation(const LLUUID& dest_id, const std::string& action);
static void saveMultipleTextures(const std::vector<std::string>& filenames, std::set<LLFolderViewItem*> selected_items, LLInventoryModel* model);
diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp
index c4f93cee98..56c5049019 100644
--- a/indra/newview/llinventorygallery.cpp
+++ b/indra/newview/llinventorygallery.cpp
@@ -634,7 +634,7 @@ void LLInventoryGallery::removeFromLastRow(LLInventoryGalleryItem* item)
mItemPanels.pop_back();
}
-LLInventoryGalleryItem* LLInventoryGallery::buildGalleryItem(std::string name, LLUUID item_id, LLAssetType::EType type, LLUUID thumbnail_id, LLInventoryType::EType inventory_type, U32 flags, time_t creation_date, bool is_link, bool is_worn)
+LLInventoryGalleryItem* LLInventoryGallery::buildGalleryItem(std::string name, LLUUID item_id, LLAssetType::EType type, LLUUID thumbnail_id, LLInventoryType::EType inventory_type, U32 flags, time_t creation_date, bool is_link, bool is_worn, bool is_favorite)
{
LLInventoryGalleryItem::Params giparams;
giparams.visible = true;
@@ -645,6 +645,7 @@ LLInventoryGalleryItem* LLInventoryGallery::buildGalleryItem(std::string name, L
gitem->setUUID(item_id);
gitem->setGallery(this);
gitem->setType(type, inventory_type, flags, is_link);
+ gitem->setFavorite(is_favorite);
gitem->setLoadImmediately(mLoadThumbnailsImmediately);
gitem->setThumbnail(thumbnail_id);
gitem->setWorn(is_worn);
@@ -937,8 +938,19 @@ bool LLInventoryGallery::updateAddedItem(LLUUID item_id)
}
bool res = false;
-
- LLInventoryGalleryItem* item = buildGalleryItem(name, item_id, obj->getType(), thumbnail_id, inventory_type, misc_flags, obj->getCreationDate(), obj->getIsLinkType(), is_worn);
+ bool is_favorite = get_is_favorite(obj);
+
+ LLInventoryGalleryItem* item = buildGalleryItem(
+ name,
+ item_id,
+ obj->getType(),
+ thumbnail_id,
+ inventory_type,
+ misc_flags,
+ obj->getCreationDate(),
+ obj->getIsLinkType(),
+ is_worn,
+ is_favorite);
mItemMap.insert(LLInventoryGallery::gallery_item_map_t::value_type(item_id, item));
if (mGalleryCreated)
{
@@ -975,7 +987,7 @@ void LLInventoryGallery::updateRemovedItem(LLUUID item_id)
mItemBuildQuery.erase(item_id);
}
-void LLInventoryGallery::updateChangedItemName(LLUUID item_id, std::string name)
+void LLInventoryGallery::updateChangedItemData(LLUUID item_id, std::string name, bool is_favorite)
{
gallery_item_map_t::iterator iter = mItemMap.find(item_id);
if (iter != mItemMap.end())
@@ -984,6 +996,7 @@ void LLInventoryGallery::updateChangedItemName(LLUUID item_id, std::string name)
if (item)
{
item->setItemName(name);
+ item->setFavorite(is_favorite);
}
}
}
@@ -1999,7 +2012,7 @@ void LLInventoryGallery::deleteSelection()
for (LLInventoryModel::item_array_t::value_type& item : items)
{
- if (get_is_item_worn(item))
+ if (!item->getIsLinkType() && get_is_item_worn(item))
{
has_worn = true;
LLWearableType::EType type = item->getWearableType();
@@ -2020,7 +2033,7 @@ void LLInventoryGallery::deleteSelection()
}
LLViewerInventoryItem* item = gInventory.getItem(id);
- if (item && get_is_item_worn(item))
+ if (item && !item->getIsLinkType() && get_is_item_worn(item))
{
has_worn = true;
LLWearableType::EType type = item->getWearableType();
@@ -2333,7 +2346,7 @@ void LLInventoryGallery::refreshList(const LLUUID& category_id)
return;
}
- updateChangedItemName(*items_iter, obj->getName());
+ updateChangedItemData(*items_iter, obj->getName(), get_is_favorite(obj));
mNeedsArrange = true;
}
@@ -2849,6 +2862,14 @@ void LLInventoryGalleryItem::setType(LLAssetType::EType type, LLInventoryType::E
getChild<LLIconCtrl>("link_overlay")->setVisible(is_link);
}
+void LLInventoryGalleryItem::setFavorite(bool is_favorite)
+{
+ getChild<LLIconCtrl>("fav_icon")->setVisible(is_favorite);
+ static const LLUIColor text_color = LLUIColorTable::instance().getColor("LabelTextColor", LLColor4::white);
+ static const LLUIColor favorite_color = LLUIColorTable::instance().getColor("InventoryFavoriteColor", LLColor4::white);
+ mNameText->setReadOnlyColor(is_favorite ? favorite_color : text_color);
+}
+
void LLInventoryGalleryItem::setThumbnail(LLUUID id)
{
mDefaultImage = id.isNull();
diff --git a/indra/newview/llinventorygallery.h b/indra/newview/llinventorygallery.h
index 59d08d19ed..7f53f9998d 100644
--- a/indra/newview/llinventorygallery.h
+++ b/indra/newview/llinventorygallery.h
@@ -102,7 +102,7 @@ public:
void getCurrentCategories(uuid_vec_t& vcur);
bool updateAddedItem(LLUUID item_id); // returns true if added item is visible
void updateRemovedItem(LLUUID item_id);
- void updateChangedItemName(LLUUID item_id, std::string name);
+ void updateChangedItemData(LLUUID item_id, std::string name, bool is_favorite);
void updateItemThumbnail(LLUUID item_id);
void updateWornItem(LLUUID item_id, bool is_worn);
@@ -227,7 +227,7 @@ private:
bool updateRowsIfNeeded();
void updateGalleryWidth();
- LLInventoryGalleryItem* buildGalleryItem(std::string name, LLUUID item_id, LLAssetType::EType type, LLUUID thumbnail_id, LLInventoryType::EType inventory_type, U32 flags, time_t creation_date, bool is_link, bool is_worn);
+ LLInventoryGalleryItem* buildGalleryItem(std::string name, LLUUID item_id, LLAssetType::EType type, LLUUID thumbnail_id, LLInventoryType::EType inventory_type, U32 flags, time_t creation_date, bool is_link, bool is_worn, bool is_favorite);
LLInventoryGalleryItem* getItem(const LLUUID& id) const;
void buildGalleryPanel(int row_count);
@@ -343,6 +343,7 @@ public:
void setHidden(bool hidden) {mHidden = hidden;}
void setType(LLAssetType::EType type, LLInventoryType::EType inventory_type, U32 flags, bool is_link);
+ void setFavorite(bool is_favorite);
LLAssetType::EType getAssetType() { return mType; }
void setThumbnail(LLUUID id);
void setGallery(LLInventoryGallery* gallery) { mGallery = gallery; }
diff --git a/indra/newview/llinventorygallerymenu.cpp b/indra/newview/llinventorygallerymenu.cpp
index 0c35a7f695..d0747e7a8d 100644
--- a/indra/newview/llinventorygallerymenu.cpp
+++ b/indra/newview/llinventorygallerymenu.cpp
@@ -252,6 +252,20 @@ void LLInventoryGalleryContextMenu::doToSelected(const LLSD& userdata)
{
ungroup_folder_items(mUUIDs.front());
}
+ else if ("add_to_favorites" == action)
+ {
+ for (const LLUUID& id : mUUIDs)
+ {
+ set_favorite(id, true);
+ }
+ }
+ else if ("remove_from_favorites" == action)
+ {
+ for (const LLUUID& id : mUUIDs)
+ {
+ set_favorite(id, false);
+ }
+ }
else if ("replaceoutfit" == action)
{
modify_outfit(false, mUUIDs.front(), &gInventory);
@@ -474,22 +488,7 @@ void LLInventoryGalleryContextMenu::onRename(const LLSD& notification, const LLS
void LLInventoryGalleryContextMenu::fileUploadLocation(const LLSD& userdata)
{
const std::string param = userdata.asString();
- if (param == "model")
- {
- gSavedPerAccountSettings.setString("ModelUploadFolder", mUUIDs.front().asString());
- }
- else if (param == "texture")
- {
- gSavedPerAccountSettings.setString("TextureUploadFolder", mUUIDs.front().asString());
- }
- else if (param == "sound")
- {
- gSavedPerAccountSettings.setString("SoundUploadFolder", mUUIDs.front().asString());
- }
- else if (param == "animation")
- {
- gSavedPerAccountSettings.setString("AnimationUploadFolder", mUUIDs.front().asString());
- }
+ LLInventoryAction::fileUploadLocation(mUUIDs.front(), param);
}
bool LLInventoryGalleryContextMenu::canSetUploadLocation(const LLSD& userdata)
@@ -787,6 +786,7 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men
{
items.push_back(std::string("New Folder"));
}
+ items.push_back(std::string("upload_options"));
items.push_back(std::string("upload_def"));
}
@@ -797,6 +797,18 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men
items.push_back(std::string("New Outfit"));
}
+ if (!is_trash && !is_in_trash && gInventory.getRootFolderID() != selected_id)
+ {
+ if (get_is_favorite(obj))
+ {
+ items.push_back(std::string("Remove from Favorites"));
+ }
+ else
+ {
+ items.push_back(std::string("Add to Favorites"));
+ }
+ }
+
items.push_back(std::string("Subfolder Separator"));
if (!is_system_folder && !isRootFolder())
{
@@ -842,6 +854,17 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men
if(is_agent_inventory)
{
items.push_back(std::string("Cut"));
+ if (!is_in_trash)
+ {
+ if (get_is_favorite(obj))
+ {
+ items.push_back(std::string("Remove from Favorites"));
+ }
+ else
+ {
+ items.push_back(std::string("Add to Favorites"));
+ }
+ }
if (!is_link || !is_cof || !get_is_item_worn(selected_id))
{
items.push_back(std::string("Delete"));
@@ -980,6 +1003,7 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men
}
disabled_items.push_back(std::string("New Folder"));
+ disabled_items.push_back(std::string("upload_options"));
disabled_items.push_back(std::string("upload_def"));
disabled_items.push_back(std::string("create_new"));
}
@@ -1030,6 +1054,15 @@ void LLInventoryGalleryContextMenu::updateMenuItemsVisibility(LLContextMenu* men
disabled_items.push_back(std::string("Marketplace Move"));
}
}
+
+ if (get_is_favorite(obj))
+ {
+ items.push_back(std::string("Remove from Favorites"));
+ }
+ else if (is_agent_inventory)
+ {
+ items.push_back(std::string("Add to Favorites"));
+ }
}
hide_context_entries(*menu, items, disabled_items);
diff --git a/indra/newview/llinventoryitemslist.cpp b/indra/newview/llinventoryitemslist.cpp
index 2e0669fc38..cfa37cc3ee 100644
--- a/indra/newview/llinventoryitemslist.cpp
+++ b/indra/newview/llinventoryitemslist.cpp
@@ -115,7 +115,7 @@ void LLInventoryItemsList::doIdle()
{
if (mRefreshState == REFRESH_COMPLETE) return;
- if (isInVisibleChain() || mForceRefresh )
+ if (isInVisibleChain() || mForceRefresh || !getFilterSubString().empty())
{
refresh();
diff --git a/indra/newview/llinventorylistitem.cpp b/indra/newview/llinventorylistitem.cpp
index e210975a5a..5fb5b0f23f 100644
--- a/indra/newview/llinventorylistitem.cpp
+++ b/indra/newview/llinventorylistitem.cpp
@@ -43,7 +43,19 @@
static LLWidgetNameRegistry::StaticRegistrar sRegisterPanelInventoryListItemBaseParams(&typeid(LLPanelInventoryListItemBase::Params), "inventory_list_item");
-static const S32 WIDGET_SPACING = 3;
+constexpr S32 WIDGET_SPACING = 3;
+constexpr S32 FAVORITE_IMAGE_SIZE = 14;
+constexpr S32 FAVORITE_IMAGE_PAD = 3;
+
+bool get_is_item_favorite(const LLViewerInventoryItem* inv)
+{
+ if (inv->getIsLinkType())
+ {
+ LLInventoryObject* obj = gInventory.getObject(inv->getLinkedUUID());
+ return obj && obj->getIsFavorite();
+ }
+ return inv->getIsFavorite();
+}
LLPanelInventoryListItemBase::Params::Params()
: default_style("default_style"),
@@ -75,19 +87,30 @@ void LLPanelInventoryListItemBase::draw()
LLViewerInventoryItem* inv_item = getItem();
if (inv_item)
{
- updateItem(inv_item->getName());
+ updateItem(inv_item->getName(), get_is_item_favorite(inv_item));
}
setNeedsRefresh(false);
}
+ static LLUICachedControl<bool> draw_star("InventoryFavoritesUseStar", true);
+
+ LLRect local_rect = getLocalRect();
if (mHovered && mHoverImage)
{
- mHoverImage->draw(getLocalRect());
+ mHoverImage->draw(local_rect);
+ }
+ else if (mIsFavorite && draw_star())
+ {
+
+ static LLPointer<LLUIImage> fav_img = LLRender2D::getInstance()->getUIImage("Inv_Favorite_Star_Full");
+ gl_draw_scaled_image(
+ local_rect.getWidth() - FAVORITE_IMAGE_SIZE - FAVORITE_IMAGE_PAD, FAVORITE_IMAGE_PAD,
+ FAVORITE_IMAGE_SIZE, FAVORITE_IMAGE_SIZE, fav_img->getImage());
}
if (mSelected && mSelectedImage)
{
- mSelectedImage->draw(getLocalRect());
+ mSelectedImage->draw(local_rect);
}
if (mSeparatorVisible && mSeparatorImage)
@@ -95,7 +118,7 @@ void LLPanelInventoryListItemBase::draw()
// place under bottom of listitem, using image height
// item_pad in list using the item should be >= image height
// to avoid cropping of top of the next item.
- LLRect separator_rect = getLocalRect();
+ LLRect separator_rect = local_rect;
separator_rect.mTop = separator_rect.mBottom;
separator_rect.mBottom -= mSeparatorImage->getHeight();
F32 alpha = getCurrentTransparency();
@@ -107,9 +130,15 @@ void LLPanelInventoryListItemBase::draw()
// virtual
void LLPanelInventoryListItemBase::updateItem(const std::string& name,
+ bool favorite,
EItemState item_state)
{
setIconImage(mIconImage);
+ if (mIsFavorite != favorite)
+ {
+ mIsFavorite = favorite;
+ reshapeMiddleWidgets();
+ }
setTitle(name, mHighlightedText, item_state);
}
@@ -164,7 +193,7 @@ bool LLPanelInventoryListItemBase::postBuild()
if (inv_item)
{
mIconImage = LLInventoryIcon::getIcon(inv_item->getType(), inv_item->getInventoryType(), inv_item->getFlags(), false);
- updateItem(inv_item->getName());
+ updateItem(inv_item->getName(), get_is_item_favorite(inv_item));
}
setNeedsRefresh(true);
@@ -290,6 +319,7 @@ LLPanelInventoryListItemBase::LLPanelInventoryListItemBase(LLViewerInventoryItem
mHovered(false),
mSelected(false),
mSeparatorVisible(false),
+ mIsFavorite(false),
mHoverImage(params.hover_image),
mSelectedImage(params.selected_image),
mSeparatorImage(params.separator_image)
@@ -392,6 +422,16 @@ void LLPanelInventoryListItemBase::setTitle(const std::string& title,
default:;
}
+ if (mIsFavorite)
+ {
+ static LLUICachedControl<bool> use_color("InventoryFavoritesColorText", true);
+ if (use_color)
+ {
+ static const LLUIColor favorite_color = LLUIColorTable::instance().getColor("InventoryFavoriteColor", LLColor4::white);
+ style_params.color = favorite_color;
+ }
+ }
+
LLTextUtil::textboxSetHighlightedVal(
mTitleCtrl,
style_params,
@@ -466,6 +506,10 @@ void LLPanelInventoryListItemBase::reshapeMiddleWidgets()
S32 name_left = icon_rect.mRight + getWidgetSpacing();
S32 name_right = getLocalRect().getWidth() - mRightWidgetsWidth - getWidgetSpacing();
+ if (mIsFavorite)
+ {
+ name_right -= FAVORITE_IMAGE_SIZE + FAVORITE_IMAGE_PAD;
+ }
LLRect name_rect(mTitleCtrl->getRect());
name_rect.set(name_left, name_rect.mTop, name_right, name_rect.mBottom);
mTitleCtrl->setShape(name_rect);
diff --git a/indra/newview/llinventorylistitem.h b/indra/newview/llinventorylistitem.h
index 21540a380b..40a86001a4 100644
--- a/indra/newview/llinventorylistitem.h
+++ b/indra/newview/llinventorylistitem.h
@@ -167,6 +167,7 @@ protected:
* Called after inventory item was updated, update panel widgets to reflect inventory changes.
*/
virtual void updateItem(const std::string& name,
+ bool favorite,
EItemState item_state = IS_DEFAULT);
void setLeftWidgetsWidth(S32 width) { mLeftWidgetsWidth = width; }
@@ -222,8 +223,9 @@ private:
LLUIImagePtr mSelectedImage;
LLUIImagePtr mSeparatorImage;
- bool mSelected;
- bool mSeparatorVisible;
+ bool mSelected = false;
+ bool mSeparatorVisible = false;
+ bool mIsFavorite = false; // note that any setter needs to update tittle
std::string mHighlightedText;
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index b6ff31a7ed..bc33f29c33 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -78,7 +78,7 @@
// Increment this if the inventory contents change in a non-backwards-compatible way.
// For viewer 2, the addition of link items makes a pre-viewer-2 cache incorrect.
-const S32 LLInventoryModel::sCurrentInvCacheVersion = 3;
+const S32 LLInventoryModel::sCurrentInvCacheVersion = 4;
bool LLInventoryModel::sFirstTimeInViewer2 = true;
S32 LLInventoryModel::sPendingSystemFolders = 0;
@@ -2806,8 +2806,9 @@ bool LLInventoryModel::loadSkeleton(
cached_ids.insert(tcat->getUUID());
// At the moment download does not provide a thumbnail
- // uuid, use the one from cache
+ // uuid or favorite, use values from cache
tcat->setThumbnailUUID(cat->getThumbnailUUID());
+ tcat->setFavorite(cat->getIsFavorite());
}
}
diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp
index ac791e224e..ac22be9d5a 100644
--- a/indra/newview/llinventoryobserver.cpp
+++ b/indra/newview/llinventoryobserver.cpp
@@ -749,6 +749,13 @@ void LLInventoryCategoriesObserver::changed(U32 mask)
cat_changed = true;
}
+ bool is_favorite = category->getIsFavorite();
+ if (cat_data.mIsFavorite != is_favorite)
+ {
+ cat_data.mIsFavorite = is_favorite;
+ cat_changed = true;
+ }
+
// If anything has changed above, fire the callback.
if (cat_changed)
cat_data.mCallback();
@@ -766,6 +773,7 @@ bool LLInventoryCategoriesObserver::addCategory(const LLUUID& cat_id, callback_t
S32 version = LLViewerInventoryCategory::VERSION_UNKNOWN;
S32 current_num_known_descendents = LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN;
bool can_be_added = true;
+ bool favorite = false;
LLUUID thumbnail_id;
LLViewerInventoryCategory* category = gInventory.getCategory(cat_id);
@@ -779,6 +787,7 @@ bool LLInventoryCategoriesObserver::addCategory(const LLUUID& cat_id, callback_t
// to a category have been made.
version = category->getVersion();
thumbnail_id = category->getThumbnailUUID();
+ favorite = category->getIsFavorite();
LLInventoryModel::cat_array_t* cats;
LLInventoryModel::item_array_t* items;
@@ -804,11 +813,11 @@ bool LLInventoryCategoriesObserver::addCategory(const LLUUID& cat_id, callback_t
if(init_name_hash)
{
digest_t item_name_hash = gInventory.hashDirectDescendentNames(cat_id);
- mCategoryMap.insert(category_map_value_t(cat_id,LLCategoryData(cat_id, thumbnail_id, cb, version, current_num_known_descendents,item_name_hash)));
+ mCategoryMap.insert(category_map_value_t(cat_id,LLCategoryData(cat_id, thumbnail_id, favorite, cb, version, current_num_known_descendents,item_name_hash)));
}
else
{
- mCategoryMap.insert(category_map_value_t(cat_id,LLCategoryData(cat_id, thumbnail_id, cb, version, current_num_known_descendents)));
+ mCategoryMap.insert(category_map_value_t(cat_id,LLCategoryData(cat_id, thumbnail_id, favorite, cb, version, current_num_known_descendents)));
}
}
@@ -821,25 +830,37 @@ void LLInventoryCategoriesObserver::removeCategory(const LLUUID& cat_id)
}
LLInventoryCategoriesObserver::LLCategoryData::LLCategoryData(
- const LLUUID& cat_id, const LLUUID& thumbnail_id, callback_t cb, S32 version, S32 num_descendents)
+ const LLUUID& cat_id,
+ const LLUUID& thumbnail_id,
+ bool is_favorite,
+ callback_t cb,
+ S32 version,
+ S32 num_descendents)
: mCatID(cat_id)
, mCallback(cb)
, mVersion(version)
, mDescendentsCount(num_descendents)
, mThumbnailId(thumbnail_id)
+ , mIsFavorite(is_favorite)
, mIsNameHashInitialized(false)
{
}
LLInventoryCategoriesObserver::LLCategoryData::LLCategoryData(
- const LLUUID& cat_id, const LLUUID& thumbnail_id, callback_t cb, S32 version, S32 num_descendents, const digest_t& name_hash)
+ const LLUUID& cat_id,
+ const LLUUID& thumbnail_id,
+ bool is_favorite,
+ callback_t cb, S32 version,
+ S32 num_descendents,
+ const digest_t& name_hash)
: mCatID(cat_id)
, mCallback(cb)
, mVersion(version)
, mDescendentsCount(num_descendents)
, mThumbnailId(thumbnail_id)
+ , mIsFavorite(is_favorite)
, mIsNameHashInitialized(true)
, mItemNameHash(name_hash)
{
diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h
index 950b02d3cf..12d6c44521 100644
--- a/indra/newview/llinventoryobserver.h
+++ b/indra/newview/llinventoryobserver.h
@@ -60,6 +60,7 @@ public:
CREATE = 512, // With ADD, item has just been created.
// unfortunately a particular message is still associated with some unique semantics.
UPDATE_CREATE = 1024, // With ADD, item added via UpdateCreateInventoryItem
+ UPDATE_FAVORITE = 2048, // With ADD, item added via UpdateCreateInventoryItem
ALL = 0xffffffff
};
LLInventoryObserver();
@@ -276,12 +277,26 @@ protected:
typedef LLUUID digest_t; // To clarify the actual usage of this "UUID"
struct LLCategoryData
{
- LLCategoryData(const LLUUID& cat_id, const LLUUID& thumbnail_id, callback_t cb, S32 version, S32 num_descendents);
- LLCategoryData(const LLUUID& cat_id, const LLUUID& thumbnail_id, callback_t cb, S32 version, S32 num_descendents, const digest_t& name_hash);
+ LLCategoryData(
+ const LLUUID& cat_id,
+ const LLUUID& thumbnail_id,
+ bool is_favorite,
+ callback_t cb,
+ S32 version,
+ S32 num_descendents);
+ LLCategoryData(
+ const LLUUID& cat_id,
+ const LLUUID& thumbnail_id,
+ bool is_favorite,
+ callback_t cb,
+ S32 version,
+ S32 num_descendents,
+ const digest_t& name_hash);
callback_t mCallback;
S32 mVersion;
S32 mDescendentsCount;
digest_t mItemNameHash;
+ bool mIsFavorite;
bool mIsNameHashInitialized;
LLUUID mCatID;
LLUUID mThumbnailId;
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 1795de727d..1f6da85d22 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -55,11 +55,13 @@
#include "llviewerfoldertype.h"
#include "llvoavatarself.h"
+class LLInventoryFavoritesItemsPanel;
class LLInventoryRecentItemsPanel;
class LLAssetFilteredInventoryPanel;
static LLDefaultChildRegistry::Register<LLInventoryPanel> r("inventory_panel");
static LLDefaultChildRegistry::Register<LLInventoryRecentItemsPanel> t_recent_inventory_panel("recent_inventory_panel");
+static LLDefaultChildRegistry::Register<LLInventoryFavoritesItemsPanel> t_favorites_inventory_panel("favorites_inventory_panel");
static LLDefaultChildRegistry::Register<LLAssetFilteredInventoryPanel> t_asset_filtered_inv_panel("asset_filtered_inv_panel");
const std::string LLInventoryPanel::DEFAULT_SORT_ORDER = std::string("InventorySortOrder");
@@ -623,6 +625,19 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve
}
}
+ if (mask & LLInventoryObserver::UPDATE_FAVORITE)
+ {
+ if (view_item)
+ {
+ view_item->refresh();
+ LLFolderViewFolder* parent = view_item->getParentFolder();
+ if (parent)
+ {
+ parent->updateHasFavorites(get_is_favorite(model_item));
+ }
+ }
+ }
+
// We don't typically care which of these masks the item is actually flagged with, since the masks
// may not be accurate (e.g. in the main inventory panel, I move an item from My Inventory into
// Landmarks; this is a STRUCTURE change for that panel but is an ADD change for the Landmarks
@@ -651,6 +666,16 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve
setSelection(item_id, false);
}
updateFolderLabel(model_item->getParentUUID());
+
+ if (get_is_favorite(model_item))
+ {
+ LLFolderViewFolder* new_parent = getFolderByID(model_item->getParentUUID());
+ if (new_parent)
+ {
+ new_parent->updateHasFavorites(true);
+ }
+ }
+
}
//////////////////////////////
@@ -664,9 +689,11 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve
{
LLFolderViewModelItem* old_parent_vmi = old_parent->getViewModelItem();
LLFolderViewModelItemInventory* viewmodel_folder = static_cast<LLFolderViewModelItemInventory*>(old_parent_vmi);
- LLFolderViewFolder* new_parent = (LLFolderViewFolder*)getItemByID(model_item->getParentUUID());
- // Item has been moved.
- if (old_parent != new_parent)
+ LLFolderViewFolder* new_parent = getFolderByID(model_item->getParentUUID());
+
+ if (old_parent != new_parent // Item has been moved.
+ && (new_parent != NULL || !isInRootContent(item_id, view_item)) // item is not or shouldn't be in root content
+ )
{
if (new_parent != NULL)
{
@@ -701,9 +728,21 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve
{
old_parent_vmi->dirtyDescendantsFilter();
}
+
+ if (view_item->isFavorite())
+ {
+ if (old_parent)
+ {
+ old_parent->updateHasFavorites(false); // favorite was removed
+ }
+ if (new_parent)
+ {
+ new_parent->updateHasFavorites(true); // favorite was added
+ }
}
}
}
+ }
//////////////////////////////
// REMOVE Operation
@@ -726,6 +765,10 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve
updateFolderLabel(viewmodel_folder->getUUID());
}
}
+ if (view_item->isFavorite())
+ {
+ parent->updateHasFavorites(false); // favorite was removed
+ }
}
}
}
@@ -843,7 +886,23 @@ void LLInventoryPanel::idle(void* user_data)
bool in_visible_chain = panel->isInVisibleChain();
- if (!panel->mBuildViewsQueue.empty())
+ if (!panel->mBuildRootQueue.empty())
+ {
+ const F64 max_time = in_visible_chain ? 0.006f : 0.001f; // 6 ms
+ F64 curent_time = LLTimer::getTotalSeconds();
+ panel->mBuildViewsEndTime = curent_time + max_time;
+
+ while (curent_time < panel->mBuildViewsEndTime
+ && !panel->mBuildRootQueue.empty())
+ {
+ LLUUID item_id = panel->mBuildRootQueue.back();
+ panel->mBuildRootQueue.pop_back();
+ panel->findAndInitRootContent(item_id);
+
+ curent_time = LLTimer::getTotalSeconds();
+ }
+ }
+ else if (!panel->mBuildViewsQueue.empty())
{
const F64 max_time = in_visible_chain ? 0.006f : 0.001f; // 6 ms
F64 curent_time = LLTimer::getTotalSeconds();
@@ -925,20 +984,9 @@ void LLInventoryPanel::initializeViews(F64 max_time)
mBuildViewsEndTime = curent_time + max_time;
// init everything
- LLUUID root_id = getRootFolderID();
- if (root_id.notNull())
- {
- buildNewViews(getRootFolderID());
- }
- else
- {
- // Default case: always add "My Inventory" root first, "Library" root second
- // If we run out of time, this still should create root folders
- buildNewViews(gInventory.getRootFolderID()); // My Inventory
- buildNewViews(gInventory.getLibraryRootFolderID()); // Library
- }
+ initRootContent();
- if (mBuildViewsQueue.empty())
+ if (mBuildViewsQueue.empty() && mBuildRootQueue.empty())
{
mViewsInitialized = VIEWS_INITIALIZED;
}
@@ -969,6 +1017,22 @@ void LLInventoryPanel::initializeViews(F64 max_time)
}
}
+void LLInventoryPanel::initRootContent()
+{
+ LLUUID root_id = getRootFolderID();
+ if (root_id.notNull())
+ {
+ buildNewViews(getRootFolderID());
+ }
+ else
+ {
+ // Default case: always add "My Inventory" root first, "Library" root second
+ // If we run out of time, this still should create root folders
+ buildNewViews(gInventory.getRootFolderID()); // My Inventory
+ buildNewViews(gInventory.getLibraryRootFolderID()); // Library
+ }
+}
+
LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop)
{
@@ -1740,26 +1804,8 @@ bool LLInventoryPanel::beginIMSession()
void LLInventoryPanel::fileUploadLocation(const LLSD& userdata)
{
const std::string param = userdata.asString();
- if (param == "model")
- {
- gSavedPerAccountSettings.setString("ModelUploadFolder", LLFolderBridge::sSelf.get()->getUUID().asString());
- }
- else if (param == "texture")
- {
- gSavedPerAccountSettings.setString("TextureUploadFolder", LLFolderBridge::sSelf.get()->getUUID().asString());
- }
- else if (param == "sound")
- {
- gSavedPerAccountSettings.setString("SoundUploadFolder", LLFolderBridge::sSelf.get()->getUUID().asString());
- }
- else if (param == "animation")
- {
- gSavedPerAccountSettings.setString("AnimationUploadFolder", LLFolderBridge::sSelf.get()->getUUID().asString());
- }
- else if (param == "pbr_material")
- {
- gSavedPerAccountSettings.setString("PBRUploadFolder", LLFolderBridge::sSelf.get()->getUUID().asString());
- }
+ const LLUUID dest = LLFolderBridge::sSelf.get()->getUUID();
+ LLInventoryAction::fileUploadLocation(dest, param);
}
void LLInventoryPanel::setFavoriteFolder()
@@ -2212,6 +2258,273 @@ LLInventoryRecentItemsPanel::LLInventoryRecentItemsPanel( const Params& params)
mInvFVBridgeBuilder = &RECENT_ITEMS_BUILDER;
}
+/************************************************************************/
+/* Favorites Inventory Panel related class */
+/************************************************************************/
+static const LLFavoritesInventoryBridgeBuilder FAVORITES_BUILDER;
+class LLInventoryFavoritesItemsPanel : public LLInventoryPanel
+{
+public:
+ struct Params : public LLInitParam::Block<Params, LLInventoryPanel::Params>
+ {};
+
+ void initFromParams(const Params& p)
+ {
+ LLInventoryPanel::initFromParams(p);
+ // turn off trash
+ getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() | (1ULL << LLFolderType::FT_TRASH));
+ getFilter().setFilterNoTrashFolder();
+ // turn off marketplace for favorites
+ getFilter().setFilterNoMarketplaceFolder();
+ }
+
+ void removeItemID(const LLUUID& id) override;
+ bool isInRootContent(const LLUUID& id, LLFolderViewItem* view_item) override;
+
+protected:
+ LLInventoryFavoritesItemsPanel(const Params&);
+ friend class LLUICtrlFactory;
+
+ void findAndInitRootContent(const LLUUID& folder_id) override;
+ void initRootContent() override;
+
+ // removeFavorite removes item from root, does not readd favorited children if present
+ bool removeFavorite(const LLUUID& id, const LLInventoryObject* model_item);
+ void itemChanged(const LLUUID& item_id, U32 mask, const LLInventoryObject* model_item) override;
+
+ std::set<LLUUID> mRootContentIDs;
+};
+
+LLInventoryFavoritesItemsPanel::LLInventoryFavoritesItemsPanel(const Params& params)
+ : LLInventoryPanel(params)
+{
+ // replace bridge builder to have necessary View bridges.
+ mInvFVBridgeBuilder = &FAVORITES_BUILDER;
+}
+
+void LLInventoryFavoritesItemsPanel::removeItemID(const LLUUID& id)
+{
+ std::set<LLUUID>::iterator found = mRootContentIDs.find(id);
+ if (found != mRootContentIDs.end())
+ {
+ mRootContentIDs.erase(found);
+ // check content for favorites
+ mBuildRootQueue.emplace_back(id);
+ }
+
+ LLInventoryPanel::removeItemID(id);
+}
+
+bool LLInventoryFavoritesItemsPanel::isInRootContent(const LLUUID& id, LLFolderViewItem* view_item)
+{
+ if (!view_item->isFavorite())
+ {
+ return false;
+ }
+
+ std::set<LLUUID>::iterator found = mRootContentIDs.find(id);
+ return found != mRootContentIDs.end();
+}
+
+void LLInventoryFavoritesItemsPanel::findAndInitRootContent(const LLUUID& id)
+{
+ F64 curent_time = LLTimer::getTotalSeconds();
+ if (mBuildViewsEndTime < curent_time)
+ {
+ mBuildRootQueue.emplace_back(id);
+ return;
+ }
+ LLViewerInventoryCategory::cat_array_t* categories;
+ LLViewerInventoryItem::item_array_t* items;
+ mInventory->lockDirectDescendentArrays(id, categories, items);
+
+ if (categories)
+ {
+ S32 count = static_cast<S32>(categories->size());
+ for (S32 i = 0; i < count; ++i)
+ {
+ LLViewerInventoryCategory* cat = categories->at(i);
+ if (cat->getPreferredType() == LLFolderType::FT_TRASH)
+ {
+ continue;
+ }
+ else if (cat->getIsFavorite())
+ {
+ LLFolderViewItem* folder_view_item = getItemByID(cat->getUUID());
+ if (!folder_view_item)
+ {
+ const LLUUID& parent_id = cat->getParentUUID();
+ mRootContentIDs.emplace(cat->getUUID());
+
+ buildViewsTree(cat->getUUID(), parent_id, cat, folder_view_item, mFolderRoot.get(), BUILD_TIMELIMIT);
+ }
+ }
+ else
+ {
+ findAndInitRootContent(cat->getUUID());
+ }
+ }
+ }
+
+ if (items)
+ {
+ S32 count = static_cast<S32>(items->size());
+ for (S32 i = 0; i < count; ++i)
+ {
+ LLViewerInventoryItem* item = items->at(i);
+ const LLUUID item_id = item->getUUID();
+ if (item->getIsFavorite() && typedViewsFilter(item_id, item))
+ {
+ LLFolderViewItem* folder_view_item = getItemByID(id);
+ if (!folder_view_item)
+ {
+ const LLUUID& parent_id = item->getParentUUID();
+ mRootContentIDs.emplace(item_id);
+
+ buildViewsTree(item_id, parent_id, item, folder_view_item, mFolderRoot.get(), BUILD_TIMELIMIT);
+ }
+ }
+ }
+ }
+
+ mInventory->unlockDirectDescendentArrays(id);
+}
+
+void LLInventoryFavoritesItemsPanel::initRootContent()
+{
+ findAndInitRootContent(gInventory.getRootFolderID()); // My Inventory
+}
+
+bool LLInventoryFavoritesItemsPanel::removeFavorite(const LLUUID& id, const LLInventoryObject* model_item)
+{
+ std::set<LLUUID>::iterator found = mRootContentIDs.find(id);
+ if (found == mRootContentIDs.end())
+ {
+ return false;
+ }
+
+ mRootContentIDs.erase(found);
+
+ // This item is in root's content, remove item's UI.
+ LLFolderViewItem* view_item = getItemByID(id);
+ if (view_item)
+ {
+ LLFolderViewFolder* parent = view_item->getParentFolder();
+ LLFolderViewModelItemInventory* viewmodel_item = static_cast<LLFolderViewModelItemInventory*>(view_item->getViewModelItem());
+ if (viewmodel_item)
+ {
+ removeItemID(viewmodel_item->getUUID());
+ }
+ view_item->destroyView();
+ if (parent)
+ {
+ parent->getViewModelItem()->dirtyDescendantsFilter();
+ LLFolderViewModelItemInventory* viewmodel_folder = static_cast<LLFolderViewModelItemInventory*>(parent->getViewModelItem());
+ if (viewmodel_folder)
+ {
+ updateFolderLabel(viewmodel_folder->getUUID());
+ }
+ if (view_item->isFavorite())
+ {
+ parent->updateHasFavorites(false); // favorite was removed
+ }
+ }
+ }
+
+ return true;
+}
+
+void LLInventoryFavoritesItemsPanel::itemChanged(const LLUUID& id, U32 mask, const LLInventoryObject* model_item)
+{
+ if (!model_item && !getItemByID(id))
+ {
+ // remove operation, but item is not in panel already
+ return;
+ }
+
+ bool handled = false;
+
+ if (mask & (LLInventoryObserver::UPDATE_FAVORITE |
+ LLInventoryObserver::STRUCTURE |
+ LLInventoryObserver::ADD |
+ LLInventoryObserver::REMOVE))
+ {
+ // specifically exlude links and not get_is_favorite(model_item)
+ if (model_item && model_item->getIsFavorite())
+ {
+ LLFolderViewItem* view_item = getItemByID(id);
+ if (!view_item)
+ {
+ const LLViewerInventoryCategory* cat = dynamic_cast<const LLViewerInventoryCategory*>(model_item);
+ if (cat)
+ {
+ // New favorite folder
+ if (cat->getPreferredType() != LLFolderType::FT_TRASH)
+ {
+ // If any descendants were in the list, remove them
+ // Todo: Consider implementing and checking hasFavorites to save on search
+ LLFavoritesCollector is_favorite;
+ LLInventoryModel::cat_array_t cat_array;
+ LLInventoryModel::item_array_t item_array;
+ gInventory.collectDescendentsIf(id, cat_array, item_array, false, is_favorite);
+ for (LLInventoryModel::cat_array_t::const_iterator it = cat_array.begin(); it != cat_array.end(); ++it)
+ {
+ removeFavorite((*it)->getUUID(), *it);
+ }
+ for (LLInventoryModel::item_array_t::const_iterator it = item_array.begin(); it != item_array.end(); ++it)
+ {
+ removeFavorite((*it)->getUUID(), *it);
+ }
+
+ LLFolderViewItem* folder_view_item = getItemByID(cat->getUUID());
+ if (!folder_view_item)
+ {
+ const LLUUID& parent_id = cat->getParentUUID();
+ mRootContentIDs.emplace(cat->getUUID());
+
+ buildViewsTree(cat->getUUID(), parent_id, cat, folder_view_item, mFolderRoot.get(), BUILD_ONE_FOLDER);
+ }
+ }
+ }
+ else
+ {
+ // New favorite item
+ if (model_item->getIsFavorite() && typedViewsFilter(id, model_item))
+ {
+ const LLUUID& parent_id = model_item->getParentUUID();
+ mRootContentIDs.emplace(id);
+
+ buildViewsTree(id, parent_id, model_item, NULL, mFolderRoot.get(), BUILD_ONE_FOLDER);
+ }
+ }
+ handled = true;
+ }
+ }
+ else
+ {
+ handled = removeFavorite(id, model_item);
+ if (handled)
+ {
+ const LLViewerInventoryCategory* cat = dynamic_cast<const LLViewerInventoryCategory*>(model_item);
+ // Todo: Consider implementing and checking hasFavorites to save on search
+ if (cat)
+ {
+ // re-add any favorited children
+ mBuildRootQueue.emplace_back(id);
+ }
+ }
+ }
+ }
+
+ if (!handled)
+ {
+ LLInventoryPanel::itemChanged(id, mask, model_item);
+ }
+}
+/************************************************************************/
+/* LLInventorySingleFolderPanel */
+/************************************************************************/
+
static LLDefaultChildRegistry::Register<LLInventorySingleFolderPanel> t_single_folder_inventory_panel("single_folder_inventory_panel");
LLInventorySingleFolderPanel::LLInventorySingleFolderPanel(const Params& params)
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index ab17196e5f..b7fef98413 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -252,7 +252,8 @@ public:
bool reset_filter = false);
static void setSFViewAndOpenFolder(const LLInventoryPanel* panel, const LLUUID& folder_id);
void addItemID(const LLUUID& id, LLFolderViewItem* itemp);
- void removeItemID(const LLUUID& id);
+ virtual void removeItemID(const LLUUID& id);
+ virtual bool isInRootContent(const LLUUID& id, LLFolderViewItem* view_item) { return false; }
LLFolderViewItem* getItemByID(const LLUUID& id);
LLFolderViewFolder* getFolderByID(const LLUUID& id);
void setSelectionByID(const LLUUID& obj_id, bool take_keyboard_focus);
@@ -335,6 +336,8 @@ public:
protected:
// Builds the UI. Call this once the inventory is usable.
void initializeViews(F64 max_time);
+ virtual void initRootContent();
+ virtual void findAndInitRootContent(const LLUUID& root_id) {};
// Specific inventory colors
static bool sColorSetInitialized;
@@ -372,7 +375,7 @@ protected:
virtual LLFolderViewItem* createFolderViewItem(LLInvFVBridge * bridge);
boost::function<void(const std::deque<LLFolderViewItem*>& items, bool user_action)> mSelectionCallback;
-private:
+
// buildViewsTree does not include some checks and is meant
// for recursive use, use buildNewViews() for first call
LLFolderViewItem* buildViewsTree(const LLUUID& id,
@@ -395,6 +398,8 @@ private:
EViewsInitializationState mViewsInitialized; // Whether views have been generated
F64 mBuildViewsEndTime; // Stop building views past this timestamp
std::deque<LLUUID> mBuildViewsQueue;
+ std::deque<LLUUID> mBuildRootQueue;
+
};
diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp
index 28160177f6..3bf50c8e65 100644
--- a/indra/newview/llmaterialeditor.cpp
+++ b/indra/newview/llmaterialeditor.cpp
@@ -1414,7 +1414,7 @@ bool LLMaterialEditor::saveIfNeeded()
}
std::string res_desc = buildMaterialDescription();
- createInventoryItem(buffer, mMaterialName, res_desc, local_permissions);
+ createInventoryItem(buffer, mMaterialName, res_desc, local_permissions, mUploadFolder);
// We do not update floater with uploaded asset yet, so just close it.
closeFloater();
@@ -1584,12 +1584,12 @@ private:
std::string mNewName;
};
-void LLMaterialEditor::createInventoryItem(const std::string &buffer, const std::string &name, const std::string &desc, const LLPermissions& permissions)
+void LLMaterialEditor::createInventoryItem(const std::string &buffer, const std::string &name, const std::string &desc, const LLPermissions& permissions, const LLUUID& upload_folder)
{
// gen a new uuid for this asset
LLTransactionID tid;
tid.generate(); // timestamp-based randomization + uniquification
- LLUUID parent = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_MATERIAL);
+ LLUUID parent = upload_folder.isNull() ? gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_MATERIAL) : upload_folder;
const U8 subtype = NO_INV_SUBTYPE; // TODO maybe use AT_SETTINGS and LLSettingsType::ST_MATERIAL ?
LLPointer<LLObjectsMaterialItemCallback> cb = new LLObjectsMaterialItemCallback(permissions, buffer, name);
@@ -1903,7 +1903,11 @@ static void pack_textures(
}
}
-void LLMaterialEditor::uploadMaterialFromModel(const std::string& filename, tinygltf::Model& model_in, S32 index)
+void LLMaterialEditor::uploadMaterialFromModel(
+ const std::string& filename,
+ tinygltf::Model& model_in,
+ S32 index,
+ const LLUUID& dest)
{
if (index < 0 || !LLMaterialEditor::capabilitiesAvailable())
{
@@ -1926,12 +1930,13 @@ void LLMaterialEditor::uploadMaterialFromModel(const std::string& filename, tiny
// This uses 'filename' to make sure multiple bulk uploads work
// instead of fighting for a single instance.
LLMaterialEditor* me = (LLMaterialEditor*)LLFloaterReg::getInstance("material_editor", LLSD().with("filename", filename).with("index", LLSD::Integer(index)));
+ me->mUploadFolder = dest;
me->loadMaterial(model_in, filename, index, false);
me->saveIfNeeded();
}
-void LLMaterialEditor::loadMaterialFromFile(const std::string& filename, S32 index)
+void LLMaterialEditor::loadMaterialFromFile(const std::string& filename, S32 index, const LLUUID& dest_folder)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_UI;
@@ -2431,17 +2436,17 @@ void LLMaterialEditor::onSaveObjectsMaterialAsMsgCallback(const LLSD& notificati
return;
}
- createInventoryItem(str.str(), new_name, std::string(), permissions);
+ createInventoryItem(str.str(), new_name, std::string(), permissions, LLUUID::null);
}
-const void upload_bulk(const std::vector<std::string>& filenames, LLFilePicker::ELoadFilter type, bool allow_2k);
+void upload_bulk(const std::vector<std::string>& filenames, LLFilePicker::ELoadFilter type, bool allow_2k, const LLUUID& dest);
void LLMaterialEditor::loadMaterial(const tinygltf::Model &model_in, const std::string &filename, S32 index, bool open_floater)
{
if (index == model_in.materials.size())
{
// bulk upload all the things
- upload_bulk({ filename }, LLFilePicker::FFLOAD_MATERIAL, true);
+ upload_bulk({ filename }, LLFilePicker::FFLOAD_MATERIAL, true, LLUUID::null);
return;
}
@@ -2848,10 +2853,10 @@ void LLMaterialEditor::setFromGltfMetaData(const std::string& filename, const ti
}
}
-void LLMaterialEditor::importMaterial()
+void LLMaterialEditor::importMaterial(const LLUUID dest_folder)
{
LLFilePickerReplyThread::startPicker(
- [](const std::vector<std::string>& filenames, LLFilePicker::ELoadFilter load_filter, LLFilePicker::ESaveFilter save_filter)
+ [dest_folder](const std::vector<std::string>& filenames, LLFilePicker::ELoadFilter load_filter, LLFilePicker::ESaveFilter save_filter)
{
if (LLAppViewer::instance()->quitRequested())
{
@@ -2861,7 +2866,7 @@ void LLMaterialEditor::importMaterial()
{
if (filenames.size() > 0)
{
- LLMaterialEditor::loadMaterialFromFile(filenames[0], -1);
+ LLMaterialEditor::loadMaterialFromFile(filenames[0], -1, dest_folder);
}
}
catch (std::bad_alloc&)
@@ -3549,6 +3554,7 @@ void LLMaterialEditor::saveTexture(LLImageJ2C* img, const std::string& name, con
LLFloaterPerms::getGroupPerms("Uploads"),
LLFloaterPerms::getEveryonePerms("Uploads"),
expected_upload_cost,
+ mUploadFolder,
false,
cb,
failed_upload));
diff --git a/indra/newview/llmaterialeditor.h b/indra/newview/llmaterialeditor.h
index 232467460e..1abdd7f84c 100644
--- a/indra/newview/llmaterialeditor.h
+++ b/indra/newview/llmaterialeditor.h
@@ -94,7 +94,7 @@ class LLMaterialEditor : public LLPreview, public LLVOInventoryListener
void setFromGltfMetaData(const std::string& filename, const tinygltf::Model& model, S32 index);
// open a file dialog and select a gltf/glb file for import
- static void importMaterial();
+ static void importMaterial(const LLUUID dest_folder = LLUUID::null);
// for live preview, apply current material to currently selected object
void applyToSelection();
@@ -105,8 +105,11 @@ class LLMaterialEditor : public LLPreview, public LLVOInventoryListener
void loadAsset() override;
// @index if -1 and file contains more than one material,
// will promt to select specific one
- static void uploadMaterialFromModel(const std::string& filename, tinygltf::Model& model, S32 index);
- static void loadMaterialFromFile(const std::string& filename, S32 index = -1);
+ static void uploadMaterialFromModel(const std::string& filename,
+ tinygltf::Model& model,
+ S32 index,
+ const LLUUID& dest_folder_id = LLUUID::null);
+ static void loadMaterialFromFile(const std::string& filename, S32 index = -1, const LLUUID& dest_folder = LLUUID::null);
void onSelectionChanged(); // live overrides selection changes
@@ -134,8 +137,6 @@ class LLMaterialEditor : public LLPreview, public LLVOInventoryListener
void onClickSave();
- void getGLTFModel(tinygltf::Model& model);
-
std::string getEncodedAsset();
bool decodeAsset(const std::vector<char>& buffer);
@@ -239,7 +240,7 @@ private:
static void saveObjectsMaterialAs(const LLGLTFMaterial *render_material, const LLLocalGLTFMaterial *local_material, const LLPermissions& permissions, const LLUUID& object_id /* = LLUUID::null */, const LLUUID& item /* = LLUUID::null */);
static bool updateInventoryItem(const std::string &buffer, const LLUUID &item_id, const LLUUID &task_id);
- static void createInventoryItem(const std::string &buffer, const std::string &name, const std::string &desc, const LLPermissions& permissions);
+ static void createInventoryItem(const std::string &buffer, const std::string &name, const std::string &desc, const LLPermissions& permissions, const LLUUID& upload_folder);
void setFromGLTFMaterial(LLGLTFMaterial* mat);
bool setFromSelection();
@@ -249,6 +250,7 @@ private:
friend class LLMaterialFilePicker;
LLUUID mAssetID;
+ LLUUID mUploadFolder;
LLTextureCtrl* mBaseColorTextureCtrl;
LLTextureCtrl* mMetallicTextureCtrl;
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index a8c6f69425..126579d005 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -756,8 +756,12 @@ public:
};
-void log_upload_error(LLCore::HttpStatus status, const LLSD& content,
- const char * const stage, const std::string & model_name)
+void log_upload_error(
+ LLCore::HttpStatus status,
+ const LLSD& content,
+ const char * const stage,
+ const std::string & model_name,
+ const std::vector<std::string> & texture_filenames)
{
// Add notification popup.
LLSD args;
@@ -815,6 +819,20 @@ void log_upload_error(LLCore::HttpStatus status, const LLSD& content,
error_num++;
}
}
+
+ if (err.has("TextureIndex"))
+ {
+ S32 texture_index = err["TextureIndex"].asInteger();
+ if (texture_index < texture_filenames.size())
+ {
+ args["MESSAGE"] = message + "\n" + texture_filenames[texture_index];
+ }
+ else
+ {
+ llassert(false); // figure out why or how texture wasn't in the list
+ args["MESSAGE"] = message + llformat("\nTexture index: %d", texture_index);
+ }
+ }
}
else
{
@@ -2472,7 +2490,7 @@ EMeshProcessingResult LLMeshRepoThread::physicsShapeReceived(const LLUUID& mesh_
LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data, LLVector3& scale, bool upload_textures,
bool upload_skin, bool upload_joints, bool lock_scale_if_joint_position,
- const std::string & upload_url, bool do_upload,
+ const std::string & upload_url, LLUUID destination_folder_id, bool do_upload,
LLHandle<LLWholeModelFeeObserver> fee_observer,
LLHandle<LLWholeModelUploadObserver> upload_observer)
: LLThread("mesh upload"),
@@ -2480,6 +2498,7 @@ LLMeshUploadThread::LLMeshUploadThread(LLMeshUploadThread::instance_list& data,
mDiscarded(false),
mDoUpload(do_upload),
mWholeModelUploadURL(upload_url),
+ mDestinationFolderId(destination_folder_id),
mFeeObserverHandle(fee_observer),
mUploadObserverHandle(upload_observer)
{
@@ -2596,13 +2615,21 @@ LLSD llsd_from_file(std::string filename)
return result;
}
-void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
+void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, std::vector<std::string>& texture_list_dest, bool include_textures)
{
LLSD result;
LLSD res;
+ if (mDestinationFolderId.isNull())
+ {
result["folder_id"] = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_OBJECT);
result["texture_folder_id"] = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_TEXTURE);
+ }
+ else
+ {
+ result["folder_id"] = mDestinationFolderId;
+ result["texture_folder_id"] = mDestinationFolderId;
+ }
result["asset_type"] = "mesh";
result["inventory_type"] = "object";
result["description"] = "(No Description)";
@@ -2745,7 +2772,7 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
LLPointer<LLImageJ2C> upload_file =
LLViewerTextureList::convertToUploadFile(texture->getSavedRawImage());
- if (!upload_file.isNull() && upload_file->getDataSize())
+ if (!upload_file.isNull() && upload_file->getDataSize() && !upload_file->isBufferInvalid())
{
texture_str.write((const char*) upload_file->getData(), upload_file->getDataSize());
}
@@ -2759,6 +2786,8 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
texture_index[texture] = texture_num;
std::string str = texture_str.str();
res["texture_list"][texture_num] = LLSD::Binary(str.begin(),str.end());
+ // store indexes for error handling;
+ texture_list_dest.push_back(material.mDiffuseMapFilename);
texture_num++;
}
@@ -3023,7 +3052,8 @@ void LLMeshUploadThread::doWholeModelUpload()
LL_DEBUGS(LOG_MESH) << "Hull generation completed." << LL_ENDL;
mModelData = LLSD::emptyMap();
- wholeModelToLLSD(mModelData, true);
+ mTextureFiles.clear();
+ wholeModelToLLSD(mModelData, mTextureFiles, true);
LLSD body = mModelData["asset_resources"];
dump_llsd_to_file(body, make_dump_name("whole_model_body_", dump_num));
@@ -3076,7 +3106,8 @@ void LLMeshUploadThread::requestWholeModelFee()
generateHulls();
mModelData = LLSD::emptyMap();
- wholeModelToLLSD(mModelData, false);
+ mTextureFiles.clear();
+ wholeModelToLLSD(mModelData, mTextureFiles, false);
dump_llsd_to_file(mModelData, make_dump_name("whole_model_fee_request_", dump_num));
LLCore::HttpHandle handle = LLCoreHttpUtil::requestPostWithLLSD(mHttpRequest,
mHttpPolicyClass,
@@ -3142,7 +3173,7 @@ void LLMeshUploadThread::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResp
body["error"] = LLSD::emptyMap();
body["error"]["message"] = reason;
body["error"]["identifier"] = "NetworkError"; // from asset-upload/upload_util.py
- log_upload_error(status, body, "upload", mModelData["name"].asString());
+ log_upload_error(status, body, "upload", mModelData["name"].asString(), mTextureFiles);
if (observer)
{
@@ -3177,7 +3208,7 @@ void LLMeshUploadThread::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResp
else
{
LL_WARNS(LOG_MESH) << "Upload failed. Not in expected 'complete' state." << LL_ENDL;
- log_upload_error(status, body, "upload", mModelData["name"].asString());
+ log_upload_error(status, body, "upload", mModelData["name"].asString(), mTextureFiles);
if (observer)
{
@@ -3202,7 +3233,7 @@ void LLMeshUploadThread::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResp
body["error"] = LLSD::emptyMap();
body["error"]["message"] = reason;
body["error"]["identifier"] = "NetworkError"; // from asset-upload/upload_util.py
- log_upload_error(status, body, "fee", mModelData["name"].asString());
+ log_upload_error(status, body, "fee", mModelData["name"].asString(), mTextureFiles);
if (observer)
{
@@ -3235,7 +3266,7 @@ void LLMeshUploadThread::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResp
else
{
LL_WARNS(LOG_MESH) << "Fee request failed. Not in expected 'upload' state." << LL_ENDL;
- log_upload_error(status, body, "fee", mModelData["name"].asString());
+ log_upload_error(status, body, "fee", mModelData["name"].asString(), mTextureFiles);
if (observer)
{
@@ -4973,12 +5004,12 @@ bool LLMeshRepoThread::hasHeader(const LLUUID& mesh_id) const
void LLMeshRepository::uploadModel(std::vector<LLModelInstance>& data, LLVector3& scale, bool upload_textures,
bool upload_skin, bool upload_joints, bool lock_scale_if_joint_position,
- std::string upload_url, bool do_upload,
+ std::string upload_url, const LLUUID& destination_folder_id, bool do_upload,
LLHandle<LLWholeModelFeeObserver> fee_observer, LLHandle<LLWholeModelUploadObserver> upload_observer)
{
LLMeshUploadThread* thread = new LLMeshUploadThread(data, scale, upload_textures,
upload_skin, upload_joints, lock_scale_if_joint_position,
- upload_url, do_upload, fee_observer, upload_observer);
+ upload_url, destination_folder_id, do_upload, fee_observer, upload_observer);
mUploadWaitList.push_back(thread);
}
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index 0d9da32e27..2ac90f7b10 100644
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -637,10 +637,13 @@ public:
LLHost mHost;
std::string mWholeModelFeeCapability;
std::string mWholeModelUploadURL;
+ LLUUID mDestinationFolderId;
LLMeshUploadThread(instance_list& data, LLVector3& scale, bool upload_textures,
bool upload_skin, bool upload_joints, bool lock_scale_if_joint_position,
- const std::string & upload_url, bool do_upload = true,
+ const std::string & upload_url,
+ const LLUUID destination_folder_id = LLUUID::null,
+ bool do_upload = true,
LLHandle<LLWholeModelFeeObserver> fee_observer = (LLHandle<LLWholeModelFeeObserver>()),
LLHandle<LLWholeModelUploadObserver> upload_observer = (LLHandle<LLWholeModelUploadObserver>()));
~LLMeshUploadThread();
@@ -656,7 +659,7 @@ public:
void doWholeModelUpload();
void requestWholeModelFee();
- void wholeModelToLLSD(LLSD& dest, bool include_textures);
+ void wholeModelToLLSD(LLSD& dest, std::vector<std::string>& texture_list_dest, bool include_textures);
void decomposeMeshMatrix(LLMatrix4& transformation,
LLVector3& result_pos,
@@ -677,6 +680,7 @@ private:
bool mDoUpload; // if false only model data will be requested, otherwise the model will be uploaded
LLSD mModelData;
+ std::vector<std::string> mTextureFiles;
// llcorehttp library interface objects.
LLCore::HttpStatus mHttpStatus;
@@ -799,7 +803,9 @@ public:
void uploadModel(std::vector<LLModelInstance>& data, LLVector3& scale, bool upload_textures,
bool upload_skin, bool upload_joints, bool lock_scale_if_joint_position,
- std::string upload_url, bool do_upload = true,
+ std::string upload_url,
+ const LLUUID& destination_folder_id = LLUUID::null,
+ bool do_upload = true,
LLHandle<LLWholeModelFeeObserver> fee_observer= (LLHandle<LLWholeModelFeeObserver>()),
LLHandle<LLWholeModelUploadObserver> upload_observer = (LLHandle<LLWholeModelUploadObserver>()));
diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp
index 64ea1710f5..2fdb1a7bd3 100644
--- a/indra/newview/llmodelpreview.cpp
+++ b/indra/newview/llmodelpreview.cpp
@@ -2350,7 +2350,7 @@ void LLModelPreview::updateStatusMessages()
if (lod != lod_high)
{
- if (total_submeshes[lod] && total_submeshes[lod] != total_submeshes[lod_high])
+ if (total_submeshes[lod] && total_submeshes[lod] > total_submeshes[lod_high])
{ //number of submeshes is different
message = "mesh_status_submesh_mismatch";
upload_status[lod] = 2;
@@ -3325,7 +3325,6 @@ bool LLModelPreview::render()
fmp->setViewOptionEnabled("show_skin_weight", show_skin_weight);
}
}
- //if (this) return TRUE;
if (upload_skin && !has_skin_weights)
{ //can't upload skin weights if model has no skin weights
diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp
index b1d5cd9e16..7ab63be009 100644
--- a/indra/newview/lloutfitgallery.cpp
+++ b/indra/newview/lloutfitgallery.cpp
@@ -88,9 +88,16 @@ LLOutfitGallery::LLOutfitGallery(const LLOutfitGallery::Params& p)
mItemsInRow(p.items_in_row),
mRowPanWidthFactor(p.row_panel_width_factor),
mGalleryWidthFactor(p.gallery_width_factor),
- mTextureSelected(NULL)
+ mTextureSelected(NULL),
+ mSortMenu(nullptr)
{
updateGalleryWidth();
+
+ LLControlVariable* ctrl = gSavedSettings.getControl("InventoryFavoritesColorText");
+ if (ctrl)
+ {
+ mSavedSettingInvFavColor = ctrl->getSignal()->connect(boost::bind(&LLOutfitGallery::handleInvFavColorChange, this));
+ }
}
LLOutfitGallery::Params::Params()
@@ -421,19 +428,32 @@ void LLOutfitGallery::updateRowsIfNeeded()
bool compareGalleryItem(LLOutfitGalleryItem* item1, LLOutfitGalleryItem* item2)
{
- static LLCachedControl<bool> outfit_gallery_sort_by_name(gSavedSettings, "OutfitGallerySortByName");
- if(outfit_gallery_sort_by_name ||
- ((item1->isDefaultImage() && item2->isDefaultImage()) || (!item1->isDefaultImage() && !item2->isDefaultImage())))
- {
- std::string name1 = item1->getItemName();
- std::string name2 = item2->getItemName();
-
- return (LLStringUtil::compareDict(name1, name2) < 0);
- }
- else
+ static LLCachedControl<S32> sort_by_name(gSavedSettings, "OutfitGallerySortOrder", 0);
+ switch (sort_by_name())
{
- return item2->isDefaultImage();
+ case 2:
+ // Sort by favorites - favorite items first, then alphabetically
+ if (item1->isFavorite() != item2->isFavorite())
+ {
+ return item1->isFavorite();
+ }
+ break;
+ case 1:
+ // Sort by images - items with non-default images first, then alphabetically
+ if (item1->isDefaultImage() != item2->isDefaultImage())
+ {
+ return item2->isDefaultImage();
+ }
+ break;
+ default:
+ // Sort alphabetically only
+ break;
}
+
+ // Final comparison is always alphabetical by name
+ std::string name1 = item1->getItemName();
+ std::string name2 = item2->getItemName();
+ return (LLStringUtil::compareDict(name1, name2) < 0);
}
void LLOutfitGallery::reArrangeRows(S32 row_diff)
@@ -476,6 +496,20 @@ void LLOutfitGallery::updateGalleryWidth()
mGalleryWidth = mGalleryWidthFactor * mItemsInRow - mItemHorizontalGap;
}
+void LLOutfitGallery::handleInvFavColorChange()
+{
+ for (outfit_map_t::iterator iter = mOutfitMap.begin();
+ iter != mOutfitMap.end();
+ ++iter)
+ {
+ if (!iter->second) continue;
+ LLOutfitGalleryItem* item = (LLOutfitGalleryItem*)iter->second;
+
+ // refresh font color
+ item->setOutfitFavorite(item->isFavorite());
+ }
+}
+
LLPanel* LLOutfitGallery::addLastRow()
{
mRowCount++;
@@ -627,7 +661,7 @@ void LLOutfitGallery::removeFromLastRow(LLOutfitGalleryItem* item)
mItemPanels.pop_back();
}
-LLOutfitGalleryItem* LLOutfitGallery::buildGalleryItem(std::string name, LLUUID outfit_id)
+LLOutfitGalleryItem* LLOutfitGallery::buildGalleryItem(std::string name, LLUUID outfit_id, bool is_favorite)
{
LLOutfitGalleryItem::Params giparams;
LLOutfitGalleryItem* gitem = LLUICtrlFactory::create<LLOutfitGalleryItem>(giparams);
@@ -636,6 +670,7 @@ LLOutfitGalleryItem* LLOutfitGallery::buildGalleryItem(std::string name, LLUUID
gitem->setFollowsLeft();
gitem->setFollowsTop();
gitem->setOutfitName(name);
+ gitem->setOutfitFavorite(is_favorite);
gitem->setUUID(outfit_id);
gitem->setGallery(this);
return gitem;
@@ -793,8 +828,7 @@ void LLOutfitGallery::updateAddedCategory(LLUUID cat_id)
LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id);
if (!cat) return;
- std::string name = cat->getName();
- LLOutfitGalleryItem* item = buildGalleryItem(name, cat_id);
+ LLOutfitGalleryItem* item = buildGalleryItem(cat->getName(), cat_id, cat->getIsFavorite());
mOutfitMap.insert(LLOutfitGallery::outfit_map_value_t(cat_id, item));
item->setRightMouseDownCallback(boost::bind(&LLOutfitListBase::outfitRightClickCallBack, this,
_1, _2, _3, cat_id));
@@ -863,6 +897,7 @@ void LLOutfitGallery::updateChangedCategoryName(LLViewerInventoryCategory *cat,
if (item)
{
item->setOutfitName(name);
+ item->setOutfitFavorite(cat->getIsFavorite());
}
}
}
@@ -943,6 +978,10 @@ LLOutfitListGearMenuBase* LLOutfitGallery::createGearMenu()
static LLDefaultChildRegistry::Register<LLOutfitGalleryItem> r("outfit_gallery_item");
+bool LLOutfitGalleryItem::sColorSetInitialized = false;
+LLUIColor LLOutfitGalleryItem::sDefaultTextColor;
+LLUIColor LLOutfitGalleryItem::sDefaultFavoriteColor;
+
LLOutfitGalleryItem::LLOutfitGalleryItem(const Params& p)
: LLPanel(p),
mGallery(nullptr),
@@ -954,6 +993,12 @@ LLOutfitGalleryItem::LLOutfitGalleryItem(const Params& p)
mUUID(LLUUID())
{
buildFromFile("panel_outfit_gallery_item.xml");
+ if (!sColorSetInitialized)
+ {
+ sDefaultTextColor = LLUIColorTable::instance().getColor("White", LLColor4::white);
+ sDefaultFavoriteColor = LLUIColorTable::instance().getColor("InventoryFavoriteColor", LLColor4::white);
+ sColorSetInitialized = true;
+ }
}
LLOutfitGalleryItem::~LLOutfitGalleryItem()
@@ -1000,6 +1045,19 @@ void LLOutfitGalleryItem::draw()
gl_draw_scaled_image(interior.mLeft - 1, interior.mBottom, interior.getWidth(), interior.getHeight(), mTexturep, UI_VERTEX_COLOR % alpha);
}
+ static LLUICachedControl<bool> draw_star("InventoryFavoritesUseStar", true);
+ if(mFavorite && draw_star())
+ {
+ const S32 HPAD = 3;
+ const S32 VPAD = 6; // includes padding for text and for the image
+ const S32 image_size = 14;
+ static LLPointer<LLUIImage> fav_img = LLRender2D::getInstance()->getUIImage("Inv_Favorite_Star_Full");
+
+ const F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency();
+ gl_draw_scaled_image(
+ border.getWidth() - image_size - HPAD, image_size + VPAD + mOutfitNameText->getRect().getHeight(),
+ image_size, image_size, fav_img->getImage(), UI_VERTEX_COLOR % alpha);
+ }
}
void LLOutfitGalleryItem::setOutfitName(std::string name)
@@ -1009,18 +1067,28 @@ void LLOutfitGalleryItem::setOutfitName(std::string name)
mOutfitName = name;
}
+void LLOutfitGalleryItem::setOutfitFavorite(bool is_favorite)
+{
+ mFavorite = is_favorite;
+
+ static LLCachedControl<bool> use_color(gSavedSettings, "InventoryFavoritesColorText");
+ mOutfitNameText->setReadOnlyColor((mFavorite && use_color()) ? sDefaultFavoriteColor : sDefaultTextColor);
+}
+
void LLOutfitGalleryItem::setOutfitWorn(bool value)
{
mWorn = value;
LLStringUtil::format_map_t worn_string_args;
std::string worn_string = getString("worn_string", worn_string_args);
- LLUIColor text_color = LLUIColorTable::instance().getColor("White", LLColor4::white);
- mOutfitWornText->setReadOnlyColor(text_color);
- mOutfitNameText->setReadOnlyColor(text_color);
+ mOutfitWornText->setReadOnlyColor(sDefaultTextColor.get());
+ mOutfitNameText->setReadOnlyColor(sDefaultTextColor.get());
mOutfitWornText->setFont(value ? LLFontGL::getFontSansSerifBold() : LLFontGL::getFontSansSerifSmall());
mOutfitNameText->setFont(value ? LLFontGL::getFontSansSerifBold() : LLFontGL::getFontSansSerifSmall());
mOutfitWornText->setValue(value ? worn_string : "");
mOutfitNameText->setText(mOutfitName); // refresh LLTextViewModel to pick up font changes
+
+ static LLCachedControl<bool> use_color(gSavedSettings, "InventoryFavoritesColorText");
+ mOutfitNameText->setReadOnlyColor((mFavorite && use_color()) ? sDefaultFavoriteColor : sDefaultTextColor);
}
void LLOutfitGalleryItem::setSelected(bool value)
@@ -1172,6 +1240,7 @@ LLContextMenu* LLOutfitGalleryContextMenu::createMenu()
registrar.add("Outfit.Delete", boost::bind(LLOutfitGallery::onRemoveOutfit, selected_id));
registrar.add("Outfit.Create", boost::bind(&LLOutfitGalleryContextMenu::onCreate, this, _2));
registrar.add("Outfit.Thumbnail", boost::bind(&LLOutfitGalleryContextMenu::onThumbnail, this, selected_id));
+ registrar.add("Outfit.Favorite", boost::bind(&LLOutfitGalleryContextMenu::onFavorite, this, selected_id));
registrar.add("Outfit.Save", boost::bind(&LLOutfitGalleryContextMenu::onSave, this, selected_id));
enable_registrar.add("Outfit.OnEnable", boost::bind(&LLOutfitGalleryContextMenu::onEnable, this, _2));
enable_registrar.add("Outfit.OnVisible", boost::bind(&LLOutfitGalleryContextMenu::onVisible, this, _2));
@@ -1210,25 +1279,12 @@ void LLOutfitGalleryGearMenu::onUpdateItemsVisibility()
{
if (!mMenu) return;
bool have_selection = getSelectedOutfitID().notNull();
- mMenu->setItemVisible("expand", false);
- mMenu->setItemVisible("collapse", false);
mMenu->setItemVisible("thumbnail", have_selection);
mMenu->setItemVisible("sepatator3", true);
mMenu->setItemVisible("sort_folders_by_name", true);
LLOutfitListGearMenuBase::onUpdateItemsVisibility();
}
-void LLOutfitGalleryGearMenu::onChangeSortOrder()
-{
- bool sort_by_name = !gSavedSettings.getBOOL("OutfitGallerySortByName");
- gSavedSettings.setBOOL("OutfitGallerySortByName", sort_by_name);
- LLOutfitGallery* gallery = dynamic_cast<LLOutfitGallery*>(mOutfitList);
- if (gallery)
- {
- gallery->reArrangeRows();
- }
-}
-
bool LLOutfitGalleryGearMenu::hasDefaultImage()
{
LLOutfitGallery* gallery = dynamic_cast<LLOutfitGallery*>(mOutfitList);
@@ -1345,6 +1401,15 @@ void LLOutfitGallery::refreshOutfit(const LLUUID& category_id)
}
}
+LLToggleableMenu* LLOutfitGallery::getSortMenu()
+{
+ if (!mSortMenu)
+ {
+ mSortMenu = new LLOutfitGallerySortMenu(this);
+ }
+ return mSortMenu->getMenu();
+}
+
LLUUID LLOutfitGallery::getPhotoAssetId(const LLUUID& outfit_id)
{
outfit_map_t::iterator outfit_it = mOutfitMap.find(outfit_id);
@@ -1360,3 +1425,84 @@ LLUUID LLOutfitGallery::getDefaultPhoto()
return LLUUID();
}
+
+//////////////////// LLOutfitGallerySortMenu ////////////////////
+
+LLOutfitGallerySortMenu::LLOutfitGallerySortMenu(LLOutfitListBase* parent_panel)
+ : mPanelHandle(parent_panel->getHandle())
+{
+ LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
+
+ registrar.add("Sort.OnSort", boost::bind(&LLOutfitGallerySortMenu::onSort, this, _2));
+ enable_registrar.add("Sort.OnEnable", boost::bind(&LLOutfitGallerySortMenu::onEnable, this, _2));
+
+ mMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>(
+ "menu_outfit_gallery_sort.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
+ llassert(mMenu);
+}
+
+
+LLToggleableMenu* LLOutfitGallerySortMenu::getMenu()
+{
+ return mMenu;
+}
+
+void LLOutfitGallerySortMenu::updateItemsVisibility()
+{
+ onUpdateItemsVisibility();
+}
+
+void LLOutfitGallerySortMenu::onUpdateItemsVisibility()
+{
+ if (!mMenu) return;
+}
+
+bool LLOutfitGallerySortMenu::onEnable(LLSD::String param)
+{
+ static LLCachedControl<S32> sort_order(gSavedSettings, "OutfitGallerySortOrder", 0);
+ if ("favorites_to_top" == param)
+ {
+ return sort_order == 2;
+ }
+ else if ("images_to_top" == param)
+ {
+ return sort_order == 1;
+ }
+ else if ("by_name" == param)
+ {
+ return sort_order == 0;
+ }
+
+ return false;
+}
+
+void LLOutfitGallerySortMenu::onSort(LLSD::String param)
+{
+ S32 sort_order = gSavedSettings.getS32("OutfitGallerySortOrder");
+ S32 new_sort_order = 0;
+ if ("favorites_to_top" == param)
+ {
+ new_sort_order = 2;
+ }
+ else if ("images_to_top" == param)
+ {
+ new_sort_order = 1;
+ }
+ else if ("by_name" == param)
+ {
+ new_sort_order = 0;
+ }
+ if (sort_order == new_sort_order)
+ {
+ new_sort_order = sort_order ? 0 : 1;
+ }
+ gSavedSettings.setS32("OutfitGallerySortOrder", new_sort_order);
+
+ LLOutfitGallery* gallery = dynamic_cast<LLOutfitGallery*>(mPanelHandle.get());
+ if (gallery)
+ {
+ gallery->reArrangeRows();
+ }
+}
+
diff --git a/indra/newview/lloutfitgallery.h b/indra/newview/lloutfitgallery.h
index 541ea2f9d4..5801a32a39 100644
--- a/indra/newview/lloutfitgallery.h
+++ b/indra/newview/lloutfitgallery.h
@@ -42,11 +42,13 @@ class LLOutfitGalleryItem;
class LLOutfitListGearMenuBase;
class LLOutfitGalleryGearMenu;
class LLOutfitGalleryContextMenu;
+class LLOutfitGallerySortMenu;
class LLOutfitGallery : public LLOutfitListBase
{
public:
friend class LLOutfitGalleryGearMenu;
+ friend class LLOutfitGallerySortMenu;
friend class LLOutfitGalleryContextMenu;
friend class LLUpdateGalleryOnPhotoLinked;
@@ -102,10 +104,12 @@ public:
/*virtual*/ bool getHasExpandableFolders() { return false; }
+ /*virtual*/ void onChangeSortOrder(const LLSD& userdata) {};
void updateMessageVisibility();
bool hasDefaultImage(const LLUUID& outfit_cat_id);
void refreshOutfit(const LLUUID& category_id);
+ virtual LLToggleableMenu* getSortMenu();
protected:
/*virtual*/ void onHighlightBaseOutfit(LLUUID base_id, LLUUID prev_id);
@@ -133,8 +137,9 @@ private:
void reArrangeRows(S32 row_diff = 0);
void updateRowsIfNeeded();
void updateGalleryWidth();
+ void handleInvFavColorChange();
- LLOutfitGalleryItem* buildGalleryItem(std::string name, LLUUID outfit_id);
+ LLOutfitGalleryItem* buildGalleryItem(std::string name, LLUUID outfit_id, bool is_favorite);
LLOutfitGalleryItem* getSelectedItem() const;
LLOutfitGalleryItem* getItem(const LLUUID& id) const;
@@ -176,6 +181,7 @@ private:
int mGalleryWidthFactor;
LLListContextMenu* mOutfitGalleryMenu;
+ LLOutfitGallerySortMenu* mSortMenu;
typedef std::map<LLUUID, LLOutfitGalleryItem*> outfit_map_t;
typedef outfit_map_t::value_type outfit_map_value_t;
@@ -187,6 +193,8 @@ private:
LLInventoryCategoriesObserver* mOutfitsObserver;
+
+ boost::signals2::connection mSavedSettingInvFavColor;
};
class LLOutfitGalleryContextMenu : public LLOutfitContextMenu
{
@@ -213,8 +221,6 @@ public:
protected:
/*virtual*/ void onUpdateItemsVisibility();
private:
- /*virtual*/ void onChangeSortOrder();
-
bool hasDefaultImage();
};
@@ -243,6 +249,7 @@ public:
bool setImageAssetId(LLUUID asset_id);
LLUUID getImageAssetId();
void setOutfitName(std::string name);
+ void setOutfitFavorite(bool is_favorite);
void setOutfitWorn(bool value);
void setSelected(bool value);
void setUUID(const LLUUID &outfit_id) {mUUID = outfit_id;}
@@ -250,6 +257,7 @@ public:
std::string getItemName() {return mOutfitName;}
bool isDefaultImage() {return mDefaultImage;}
+ bool isFavorite() { return mFavorite; }
bool isHidden() {return mHidden;}
void setHidden(bool hidden) {mHidden = hidden;}
@@ -267,7 +275,29 @@ private:
bool mWorn;
bool mDefaultImage;
bool mHidden;
+ bool mFavorite;
std::string mOutfitName;
+
+ static bool sColorSetInitialized;
+ static LLUIColor sDefaultTextColor;
+ static LLUIColor sDefaultFavoriteColor;
+};
+
+class LLOutfitGallerySortMenu
+{
+public:
+ LLOutfitGallerySortMenu(LLOutfitListBase* parent_panel);
+
+ LLToggleableMenu* getMenu();
+ void updateItemsVisibility();
+
+private:
+ void onUpdateItemsVisibility();
+ bool onEnable(LLSD::String param);
+ void onSort(LLSD::String param);
+
+ LLToggleableMenu* mMenu;
+ LLHandle<LLPanel> mPanelHandle;
};
#endif // LL_LLOUTFITGALLERYCTRL_H
diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp
index 6e666b8a4b..b9795f217f 100644
--- a/indra/newview/lloutfitslist.cpp
+++ b/indra/newview/lloutfitslist.cpp
@@ -35,6 +35,7 @@
#include "llaccordionctrltab.h"
#include "llagentwearables.h"
#include "llappearancemgr.h"
+#include "llappviewer.h"
#include "llfloaterreg.h"
#include "llfloatersidepanelcontainer.h"
#include "llinspecttexture.h"
@@ -45,6 +46,7 @@
#include "lloutfitobserver.h"
#include "lltoggleablemenu.h"
#include "lltransutil.h"
+#include "llviewercontrol.h"
#include "llviewermenu.h"
#include "llvoavatar.h"
#include "llvoavatarself.h"
@@ -53,14 +55,24 @@
static bool is_tab_header_clicked(LLAccordionCtrlTab* tab, S32 y);
static const LLOutfitTabNameComparator OUTFIT_TAB_NAME_COMPARATOR;
+static const LLOutfitTabFavComparator OUTFIT_TAB_FAV_COMPARATOR;
/*virtual*/
bool LLOutfitTabNameComparator::compare(const LLAccordionCtrlTab* tab1, const LLAccordionCtrlTab* tab2) const
{
- std::string name1 = tab1->getTitle();
- std::string name2 = tab2->getTitle();
+ return (LLStringUtil::compareDict(tab1->getTitle(), tab2->getTitle()) < 0);
+}
+
+bool LLOutfitTabFavComparator::compare(const LLAccordionCtrlTab* tab1, const LLAccordionCtrlTab* tab2) const
+{
+ LLOutfitAccordionCtrlTab* taba = (LLOutfitAccordionCtrlTab*)tab1;
+ LLOutfitAccordionCtrlTab* tabb = (LLOutfitAccordionCtrlTab*)tab2;
+ if (taba->getFavorite() != tabb->getFavorite())
+ {
+ return taba->getFavorite();
+ }
- return (LLStringUtil::compareDict(name1, name2) < 0);
+ return (LLStringUtil::compareDict(tab1->getTitle(), tab2->getTitle()) < 0);
}
struct outfit_accordion_tab_params : public LLInitParam::Block<outfit_accordion_tab_params, LLOutfitAccordionCtrlTab::Params>
@@ -80,6 +92,9 @@ const outfit_accordion_tab_params& get_accordion_tab_params()
{
initialized = true;
+ LLOutfitAccordionCtrlTab::sFavoriteIcon = LLUI::getUIImage("Inv_Favorite_Star_Full");
+ LLOutfitAccordionCtrlTab::sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", LLColor4U(255, 255, 255));
+
LLXMLNodePtr xmlNode;
if (LLUICtrlFactory::getLayeredXMLNode("outfit_accordion_tab.xml", xmlNode))
{
@@ -103,11 +118,20 @@ LLOutfitsList::LLOutfitsList()
, mAccordion(NULL)
, mListCommands(NULL)
, mItemSelected(false)
+ , mSortMenu(nullptr)
{
+ LLControlVariable* ctrl = gSavedSettings.getControl("InventoryFavoritesColorText");
+ if (ctrl)
+ {
+ mSavedSettingInvFavColor = ctrl->getSignal()->connect(boost::bind(&LLOutfitsList::handleInvFavColorChange, this));
+ }
}
LLOutfitsList::~LLOutfitsList()
{
+ delete mSortMenu;
+ mSavedSettingInvFavColor.disconnect();
+ mGearMenuConnection.disconnect();
}
bool LLOutfitsList::postBuild()
@@ -115,9 +139,25 @@ bool LLOutfitsList::postBuild()
mAccordion = getChild<LLAccordionCtrl>("outfits_accordion");
mAccordion->setComparator(&OUTFIT_TAB_NAME_COMPARATOR);
+ initComparator();
+
return LLOutfitListBase::postBuild();
}
+void LLOutfitsList::initComparator()
+{
+ S32 mode = gSavedSettings.getS32("OutfitListSortOrder");
+ if (mode == 0)
+ {
+ mAccordion->setComparator(&OUTFIT_TAB_NAME_COMPARATOR);
+ }
+ else
+ {
+ mAccordion->setComparator(&OUTFIT_TAB_FAV_COMPARATOR);
+ }
+ sortOutfits();
+}
+
//virtual
void LLOutfitsList::onOpen(const LLSD& info)
{
@@ -154,6 +194,7 @@ void LLOutfitsList::updateAddedCategory(LLUUID cat_id)
tab->setName(name);
tab->setTitle(name);
+ tab->setFavorite(cat->getIsFavorite());
// *TODO: LLUICtrlFactory::defaultBuilder does not use "display_children" from xml. Should be investigated.
tab->setDisplayChildren(false);
@@ -183,8 +224,9 @@ void LLOutfitsList::updateAddedCategory(LLUUID cat_id)
// Setting callback to reset items selection inside outfit on accordion collapsing and expanding (EXT-7875)
tab->setDropDownStateChangedCallback(boost::bind(&LLOutfitsList::resetItemSelection, this, list, cat_id));
- // force showing list items that don't match current filter(EXT-7158)
- list->setForceShowingUnmatchedItems(true);
+ // Depending on settings, force showing list items that don't match current filter(EXT-7158)
+ static LLCachedControl<bool> list_filter(gSavedSettings, "OutfitListFilterFullList");
+ list->setForceShowingUnmatchedItems(list_filter(), false);
// Setting list commit callback to monitor currently selected wearable item.
list->setCommitCallback(boost::bind(&LLOutfitsList::onListSelectionChange, this, _1));
@@ -249,13 +291,11 @@ void LLOutfitsList::onHighlightBaseOutfit(LLUUID base_id, LLUUID prev_id)
{
if (mOutfitsMap[prev_id])
{
- mOutfitsMap[prev_id]->setTitleFontStyle("NORMAL");
- mOutfitsMap[prev_id]->setTitleColor(LLUIColorTable::instance().getColor("AccordionHeaderTextColor"));
+ ((LLOutfitAccordionCtrlTab*)mOutfitsMap[prev_id])->setOutfitSelected(false);
}
if (mOutfitsMap[base_id])
{
- mOutfitsMap[base_id]->setTitleFontStyle("BOLD");
- mOutfitsMap[base_id]->setTitleColor(LLUIColorTable::instance().getColor("SelectedOutfitTextColor"));
+ ((LLOutfitAccordionCtrlTab*)mOutfitsMap[base_id])->setOutfitSelected(true);
}
}
@@ -313,6 +353,11 @@ void LLOutfitsList::onSetSelectedOutfitByUUID(const LLUUID& outfit_uuid)
}
}
+void LLOutfitListBase::onAction(const LLSD& userdata)
+{
+ performAction(userdata.asString());
+}
+
// virtual
bool LLOutfitListBase::isActionEnabled(const LLSD& userdata)
{
@@ -425,11 +470,12 @@ void LLOutfitsList::updateChangedCategoryName(LLViewerInventoryCategory *cat, st
if (outfits_iter != mOutfitsMap.end())
{
// Update tab name with the new category name.
- LLAccordionCtrlTab* tab = outfits_iter->second;
+ LLOutfitAccordionCtrlTab* tab = (LLOutfitAccordionCtrlTab*) outfits_iter->second;
if (tab)
{
tab->setName(name);
tab->setTitle(name);
+ tab->setFavorite(cat->getIsFavorite());
}
}
}
@@ -521,7 +567,7 @@ void LLOutfitsList::onFilterSubStringChanged(const std::string& new_string, cons
LLWearableItemsList* list = dynamic_cast<LLWearableItemsList*>(tab->getAccordionView());
if (list)
{
- list->setFilterSubString(new_string, tab->getDisplayChildren());
+ list->setFilterSubString(new_string, true);
}
if (old_string.empty())
@@ -738,6 +784,75 @@ void LLOutfitsList::onOutfitRightClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUI
}
}
+void LLOutfitsList::handleInvFavColorChange()
+{
+ for (outfits_map_t::iterator iter = mOutfitsMap.begin();
+ iter != mOutfitsMap.end();
+ ++iter)
+ {
+ if (!iter->second) continue;
+ LLOutfitAccordionCtrlTab* tab = (LLOutfitAccordionCtrlTab*)iter->second;
+
+ // refresh font color
+ tab->setFavorite(tab->getFavorite());
+ }
+}
+
+void LLOutfitsList::onChangeSortOrder(const LLSD& userdata)
+{
+ std::string sort_data = userdata.asString();
+ if (sort_data == "favorites_to_top")
+ {
+ // at the moment this is a toggle
+ S32 val = gSavedSettings.getS32("OutfitListSortOrder");
+ gSavedSettings.setS32("OutfitListSortOrder", (val ? 0 : 1));
+
+ initComparator();
+ }
+ else if (sort_data == "show_entire_outfit")
+ {
+ bool new_val = !gSavedSettings.getBOOL("OutfitListFilterFullList");
+ gSavedSettings.setBOOL("OutfitListFilterFullList", new_val);
+
+ if (!getFilterSubString().empty())
+ {
+ for (outfits_map_t::value_type& outfit : mOutfitsMap)
+ {
+ LLAccordionCtrlTab* tab = outfit.second;
+ const LLUUID& category_id = outfit.first;
+ if (!tab) continue;
+
+ LLWearableItemsList* list = dynamic_cast<LLWearableItemsList*>(tab->getAccordionView());
+ if (list)
+ {
+ list->setForceRefresh(true);
+ list->setForceShowingUnmatchedItems(new_val, tab->getDisplayChildren());
+ }
+ applyFilterToTab(category_id, tab, getFilterSubString());
+ }
+ mAccordion->arrange();
+ }
+ }
+}
+
+LLToggleableMenu* LLOutfitsList::getSortMenu()
+{
+ if (!mSortMenu)
+ {
+ mSortMenu = new LLOutfitListSortMenu(this);
+ }
+ return mSortMenu->getMenu();
+}
+
+void LLOutfitsList::updateMenuItemsVisibility()
+{
+ if (mSortMenu)
+ {
+ mSortMenu->updateItemsVisibility();
+ }
+ LLOutfitListBase::updateMenuItemsVisibility();
+}
+
LLOutfitListGearMenuBase* LLOutfitsList::createGearMenu()
{
return new LLOutfitListGearMenu(this);
@@ -755,10 +870,10 @@ bool is_tab_header_clicked(LLAccordionCtrlTab* tab, S32 y)
LLOutfitListBase::LLOutfitListBase()
: LLPanelAppearanceTab()
, mIsInitialized(false)
+ , mGearMenu(nullptr)
{
mCategoriesObserver = new LLInventoryCategoriesObserver();
mOutfitMenu = new LLOutfitContextMenu(this);
- //mGearMenu = createGearMenu();
}
LLOutfitListBase::~LLOutfitListBase()
@@ -821,6 +936,10 @@ void LLOutfitListBase::observerCallback(const LLUUID& category_id)
void LLOutfitListBase::refreshList(const LLUUID& category_id)
{
+ if (LLAppViewer::instance()->quitRequested())
+ {
+ return;
+ }
bool wasNull = mRefreshListState.CategoryUUID.isNull();
mRefreshListState.CategoryUUID.setNull();
@@ -879,8 +998,18 @@ void LLOutfitListBase::onIdle(void* userdata)
void LLOutfitListBase::onIdleRefreshList()
{
+ if (LLAppViewer::instance()->quitRequested())
+ {
+ mRefreshListState.CategoryUUID.setNull();
+ gIdleCallbacks.deleteFunction(onIdle, this);
+ return;
+ }
if (mRefreshListState.CategoryUUID.isNull())
+ {
+ LL_WARNS() << "Called onIdleRefreshList without id" << LL_ENDL;
+ gIdleCallbacks.deleteFunction(onIdle, this);
return;
+ }
const F64 MAX_TIME = 0.05f;
F64 curent_time = LLTimer::getTotalSeconds();
@@ -1022,12 +1151,6 @@ void LLOutfitListBase::ChangeOutfitSelection(LLWearableItemsList* list, const LL
bool LLOutfitListBase::postBuild()
{
- mGearMenu = createGearMenu();
-
- LLMenuButton* menu_gear_btn = getChild<LLMenuButton>("options_gear_btn");
-
- menu_gear_btn->setMouseDownCallback(boost::bind(&LLOutfitListGearMenuBase::updateItemsVisibility, mGearMenu));
- menu_gear_btn->setMenu(mGearMenu->getMenu());
return true;
}
@@ -1041,6 +1164,20 @@ void LLOutfitListBase::expandAllFolders()
onExpandAllFolders();
}
+void LLOutfitListBase::updateMenuItemsVisibility()
+{
+ mGearMenu->updateItemsVisibility();
+}
+
+LLToggleableMenu* LLOutfitListBase::getGearMenu()
+{
+ if (!mGearMenu)
+ {
+ mGearMenu = createGearMenu();
+ }
+ return mGearMenu->getMenu();
+};
+
void LLOutfitListBase::deselectOutfit(const LLUUID& category_id)
{
// Reset selection if the outfit is selected.
@@ -1067,6 +1204,7 @@ LLContextMenu* LLOutfitContextMenu::createMenu()
registrar.add("Outfit.Rename", boost::bind(renameOutfit, selected_id));
registrar.add("Outfit.Delete", boost::bind(&LLOutfitListBase::removeSelected, mOutfitList));
registrar.add("Outfit.Thumbnail", boost::bind(&LLOutfitContextMenu::onThumbnail, this, selected_id));
+ registrar.add("Outfit.Favorite", boost::bind(&LLOutfitContextMenu::onFavorite, this, selected_id));
registrar.add("Outfit.Save", boost::bind(&LLOutfitContextMenu::onSave, this, selected_id));
enable_registrar.add("Outfit.OnEnable", boost::bind(&LLOutfitContextMenu::onEnable, this, _2));
@@ -1117,6 +1255,16 @@ bool LLOutfitContextMenu::onVisible(LLSD::String param)
{
return LLAppearanceMgr::instance().getCanRemoveOutfit(outfit_cat_id);
}
+ else if ("favorites_add" == param)
+ {
+ LLViewerInventoryCategory* cat = gInventory.getCategory(outfit_cat_id);
+ return cat && !cat->getIsFavorite();
+ }
+ else if ("favorites_remove" == param)
+ {
+ LLViewerInventoryCategory* cat = gInventory.getCategory(outfit_cat_id);
+ return cat && cat->getIsFavorite();
+ }
return true;
}
@@ -1141,6 +1289,14 @@ void LLOutfitContextMenu::onThumbnail(const LLUUID &outfit_cat_id)
}
}
+void LLOutfitContextMenu::onFavorite(const LLUUID& outfit_cat_id)
+{
+ if (outfit_cat_id.notNull())
+ {
+ toggle_favorite(outfit_cat_id);
+ }
+}
+
void LLOutfitContextMenu::onSave(const LLUUID &outfit_cat_id)
{
if (outfit_cat_id.notNull())
@@ -1171,14 +1327,13 @@ LLOutfitListGearMenuBase::LLOutfitListGearMenuBase(LLOutfitListBase* olist)
registrar.add("Gear.Rename", boost::bind(&LLOutfitListGearMenuBase::onRename, this));
registrar.add("Gear.Delete", boost::bind(&LLOutfitListBase::removeSelected, mOutfitList));
registrar.add("Gear.Create", boost::bind(&LLOutfitListGearMenuBase::onCreate, this, _2));
- registrar.add("Gear.Collapse", boost::bind(&LLOutfitListBase::onCollapseAllFolders, mOutfitList));
- registrar.add("Gear.Expand", boost::bind(&LLOutfitListBase::onExpandAllFolders, mOutfitList));
registrar.add("Gear.WearAdd", boost::bind(&LLOutfitListGearMenuBase::onAdd, this));
registrar.add("Gear.Save", boost::bind(&LLOutfitListGearMenuBase::onSave, this));
registrar.add("Gear.Thumbnail", boost::bind(&LLOutfitListGearMenuBase::onThumbnail, this));
- registrar.add("Gear.SortByName", boost::bind(&LLOutfitListGearMenuBase::onChangeSortOrder, this));
+ registrar.add("Gear.Favorite", boost::bind(&LLOutfitListGearMenuBase::onFavorite, this));
+ registrar.add("Gear.SortByImage", boost::bind(&LLOutfitListGearMenuBase::onChangeSortOrder, this));
enable_registrar.add("Gear.OnEnable", boost::bind(&LLOutfitListGearMenuBase::onEnable, this, _2));
enable_registrar.add("Gear.OnVisible", boost::bind(&LLOutfitListGearMenuBase::onVisible, this, _2));
@@ -1312,6 +1467,16 @@ bool LLOutfitListGearMenuBase::onVisible(LLSD::String param)
{
return false;
}
+ else if ("favorites_add" == param)
+ {
+ LLViewerInventoryCategory* cat = gInventory.getCategory(selected_outfit_id);
+ return cat && !cat->getIsFavorite();
+ }
+ else if ("favorites_remove" == param)
+ {
+ LLViewerInventoryCategory* cat = gInventory.getCategory(selected_outfit_id);
+ return cat && cat->getIsFavorite();
+ }
return true;
}
@@ -1323,6 +1488,12 @@ void LLOutfitListGearMenuBase::onThumbnail()
LLFloaterReg::showInstance("change_item_thumbnail", data);
}
+void LLOutfitListGearMenuBase::onFavorite()
+{
+ const LLUUID& selected_outfit_id = getSelectedOutfitID();
+ toggle_favorite(selected_outfit_id);
+}
+
void LLOutfitListGearMenuBase::onChangeSortOrder()
{
@@ -1338,14 +1509,79 @@ LLOutfitListGearMenu::~LLOutfitListGearMenu()
void LLOutfitListGearMenu::onUpdateItemsVisibility()
{
if (!mMenu) return;
- mMenu->setItemVisible("expand", true);
- mMenu->setItemVisible("collapse", true);
mMenu->setItemVisible("thumbnail", getSelectedOutfitID().notNull());
+ mMenu->setItemVisible("favorite", getSelectedOutfitID().notNull());
mMenu->setItemVisible("sepatator3", false);
mMenu->setItemVisible("sort_folders_by_name", false);
LLOutfitListGearMenuBase::onUpdateItemsVisibility();
}
+//////////////////// LLOutfitListSortMenu ////////////////////
+
+LLOutfitListSortMenu::LLOutfitListSortMenu(LLOutfitListBase* parent_panel)
+ : mPanelHandle(parent_panel->getHandle())
+{
+ LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
+ LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
+
+ registrar.add("Sort.Collapse", boost::bind(&LLOutfitListBase::onCollapseAllFolders, parent_panel));
+ registrar.add("Sort.Expand", boost::bind(&LLOutfitListBase::onExpandAllFolders, parent_panel));
+ registrar.add("Sort.OnSort", boost::bind(&LLOutfitListBase::onChangeSortOrder, parent_panel, _2));
+ enable_registrar.add("Sort.OnEnable", boost::bind(&LLOutfitListSortMenu::onEnable, this, _2));
+
+ mMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>(
+ "menu_outfit_list_sort.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
+ llassert(mMenu);
+}
+
+
+LLToggleableMenu* LLOutfitListSortMenu::getMenu()
+{
+ return mMenu;
+}
+
+void LLOutfitListSortMenu::updateItemsVisibility()
+{
+ onUpdateItemsVisibility();
+}
+
+void LLOutfitListSortMenu::onUpdateItemsVisibility()
+{
+ if (!mMenu) return;
+ mMenu->setItemVisible("expand", true);
+ mMenu->setItemVisible("collapse", true);
+ mMenu->setItemVisible("sort_favorites_to_top", true);
+ mMenu->setItemVisible("show_entire_outfit_in_search", true);
+}
+
+bool LLOutfitListSortMenu::onEnable(LLSD::String param)
+{
+ if ("favorites_to_top" == param)
+ {
+ static LLCachedControl<S32> sort_order(gSavedSettings, "OutfitListSortOrder", 0);
+ return sort_order == 1;
+ }
+ else if ("show_entire_outfit" == param)
+ {
+ static LLCachedControl<bool> filter_mode(gSavedSettings, "OutfitListFilterFullList", 0);
+ return filter_mode;
+ }
+
+ return false;
+}
+
+
+//////////////////// LLOutfitAccordionCtrlTab ////////////////////
+
+LLUIImage* LLOutfitAccordionCtrlTab::sFavoriteIcon;
+LLUIColor LLOutfitAccordionCtrlTab::sFgColor;
+
+void LLOutfitAccordionCtrlTab::draw()
+{
+ LLAccordionCtrlTab::draw();
+ drawFavoriteIcon();
+}
+
bool LLOutfitAccordionCtrlTab::handleToolTip(S32 x, S32 y, MASK mask)
{
if (y >= getLocalRect().getHeight() - getHeaderHeight())
@@ -1366,4 +1602,54 @@ bool LLOutfitAccordionCtrlTab::handleToolTip(S32 x, S32 y, MASK mask)
return LLAccordionCtrlTab::handleToolTip(x, y, mask);
}
+
+void LLOutfitAccordionCtrlTab::setFavorite(bool is_favorite)
+{
+ mIsFavorite = is_favorite;
+ updateTitleColor();
+}
+
+void LLOutfitAccordionCtrlTab::setOutfitSelected(bool val)
+{
+ mIsSelected = val;
+ setTitleFontStyle(mIsSelected ? "BOLD" : "NORMAL");
+ updateTitleColor();
+ }
+
+void LLOutfitAccordionCtrlTab::updateTitleColor()
+ {
+ static LLUICachedControl<bool> highlight_color("InventoryFavoritesColorText", true);
+ if (mIsFavorite && highlight_color())
+ {
+ setTitleColor(LLUIColorTable::instance().getColor("InventoryFavoriteColor"));
+ }
+ else if (mIsSelected)
+ {
+ setTitleColor(LLUIColorTable::instance().getColor("SelectedOutfitTextColor"));
+ }
+ else
+ {
+ setTitleColor(LLUIColorTable::instance().getColor("AccordionHeaderTextColor"));
+ }
+ }
+
+void LLOutfitAccordionCtrlTab::drawFavoriteIcon()
+{
+ if (!mIsFavorite)
+ {
+ return;
+ }
+ static LLUICachedControl<bool> draw_star("InventoryFavoritesUseStar", true);
+ if (!draw_star)
+ {
+ return;
+ }
+
+ const S32 PAD = 2;
+ const S32 image_size = 18;
+
+ gl_draw_scaled_image(
+ getRect().getWidth() - image_size - PAD, getRect().getHeight() - image_size - PAD,
+ image_size, image_size, sFavoriteIcon->getImage(), sFgColor);
+}
// EOF
diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h
index f581b419d9..bafc0fbb81 100644
--- a/indra/newview/lloutfitslist.h
+++ b/indra/newview/lloutfitslist.h
@@ -41,6 +41,7 @@
class LLAccordionCtrlTab;
class LLInventoryCategoriesObserver;
class LLOutfitListGearMenuBase;
+class LLOutfitListSortMenuBase;
class LLWearableItemsList;
class LLListContextMenu;
@@ -61,6 +62,17 @@ public:
/*virtual*/ bool compare(const LLAccordionCtrlTab* tab1, const LLAccordionCtrlTab* tab2) const;
};
+class LLOutfitTabFavComparator : public LLAccordionCtrl::LLTabComparator
+{
+ LOG_CLASS(LLOutfitTabFavComparator);
+
+public:
+ LLOutfitTabFavComparator() {};
+ virtual ~LLOutfitTabFavComparator() {};
+
+ /*virtual*/ bool compare(const LLAccordionCtrlTab* tab1, const LLAccordionCtrlTab* tab2) const;
+};
+
class LLOutfitListBase : public LLPanelAppearanceTab
{
public:
@@ -92,6 +104,7 @@ public:
boost::signals2::connection setSelectionChangeCallback(selection_change_callback_t cb);
void outfitRightClickCallBack(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id);
+ void onAction(const LLSD& userdata);
virtual bool isActionEnabled(const LLSD& userdata);
virtual void performAction(std::string action);
virtual bool hasItemSelected() = 0;
@@ -109,6 +122,12 @@ public:
virtual bool getHasExpandableFolders() = 0;
+ virtual void onChangeSortOrder(const LLSD& userdata) = 0;
+
+ virtual void updateMenuItemsVisibility();
+ virtual LLToggleableMenu* getGearMenu();
+ virtual bool getTrashMenuVisible() { return true; };
+
protected:
void observerCallback(const LLUUID& category_id);
virtual LLOutfitListGearMenuBase* createGearMenu() = 0;
@@ -139,6 +158,7 @@ protected:
selection_change_signal_t mSelectionChangeSignal;
LLListContextMenu* mOutfitMenu;
LLOutfitListGearMenuBase* mGearMenu;
+ boost::signals2::connection mGearMenuConnection;
};
//////////////////////////////////////////////////////////////////////////
@@ -155,7 +175,6 @@ protected:
/* virtual */ LLContextMenu* createMenu();
bool onEnable(LLSD::String param);
-
bool onVisible(LLSD::String param);
static void editOutfit();
@@ -163,6 +182,7 @@ protected:
static void renameOutfit(const LLUUID& outfit_cat_id);
void onThumbnail(const LLUUID &outfit_cat_id);
+ void onFavorite(const LLUUID& outfit_cat_id);
void onSave(const LLUUID &outfit_cat_id);
private:
@@ -182,6 +202,7 @@ public:
protected:
virtual void onUpdateItemsVisibility();
virtual void onThumbnail();
+ virtual void onFavorite();
virtual void onChangeSortOrder();
const LLUUID& getSelectedOutfitID();
@@ -202,6 +223,23 @@ private:
bool onVisible(LLSD::String param);
};
+class LLOutfitListSortMenu
+{
+public:
+ LLOutfitListSortMenu(LLOutfitListBase* parent_panel);
+
+ LLToggleableMenu* getMenu();
+ void updateItemsVisibility();
+
+private:
+ void onUpdateItemsVisibility();
+ bool onEnable(LLSD::String param);
+
+ LLToggleableMenu* mMenu;
+ LLHandle<LLPanel> mPanelHandle;
+};
+
+
class LLOutfitListGearMenu : public LLOutfitListGearMenuBase
{
public:
@@ -221,8 +259,16 @@ public:
Params() : cat_id("cat_id") {}
};
+ virtual void draw();
virtual bool handleToolTip(S32 x, S32 y, MASK mask);
+ void setFavorite(bool is_favorite);
+ bool getFavorite() const { return mIsFavorite; }
+ void setOutfitSelected(bool val);
+
+ static LLUIImage* sFavoriteIcon;
+ static LLUIColor sFgColor;
+
protected:
LLOutfitAccordionCtrlTab(const LLOutfitAccordionCtrlTab::Params &p)
: LLAccordionCtrlTab(p),
@@ -230,7 +276,12 @@ public:
{}
friend class LLUICtrlFactory;
+ void updateTitleColor();
+ void drawFavoriteIcon();
+
LLUUID mFolderID;
+ bool mIsFavorite = false;
+ bool mIsSelected = false;
};
/**
* @class LLOutfitsList
@@ -249,6 +300,7 @@ public:
virtual ~LLOutfitsList();
/*virtual*/ bool postBuild();
+ void initComparator();
/*virtual*/ void onOpen(const LLSD& info);
@@ -287,6 +339,10 @@ public:
/*virtual*/ bool getHasExpandableFolders() { return true; }
+ /*virtual*/ void onChangeSortOrder(const LLSD& userdata);
+ virtual LLToggleableMenu* getSortMenu();
+ void updateMenuItemsVisibility();
+
protected:
LLOutfitListGearMenuBase* createGearMenu();
@@ -357,6 +413,8 @@ private:
static void onOutfitRename(const LLSD& notification, const LLSD& response);
+ void handleInvFavColorChange();
+
//LLInventoryCategoriesObserver* mCategoriesObserver;
LLAccordionCtrl* mAccordion;
@@ -374,13 +432,15 @@ private:
// Used to monitor COF changes for updating items worn state. See EXT-8636.
uuid_vec_t mCOFLinkedItems;
- //LLOutfitListGearMenu* mGearMenu;
+ LLOutfitListSortMenu* mSortMenu;
//bool mIsInitialized;
/**
* True if there is a selection inside currently selected outfit
*/
bool mItemSelected;
+
+ boost::signals2::connection mSavedSettingInvFavColor;
};
#endif //LL_LLOUTFITSLIST_H
diff --git a/indra/newview/llpanelappearancetab.h b/indra/newview/llpanelappearancetab.h
index e4d16582de..e088c3e6f0 100644
--- a/indra/newview/llpanelappearancetab.h
+++ b/indra/newview/llpanelappearancetab.h
@@ -29,6 +29,8 @@
#include "llpanel.h"
+class LLToggleableMenu;
+
class LLPanelAppearanceTab : public LLPanel
{
public:
@@ -47,6 +49,11 @@ public:
const std::string& getFilterSubString() { return mFilterSubString; }
+ virtual void updateMenuItemsVisibility() = 0;
+ virtual LLToggleableMenu* getGearMenu() = 0;
+ virtual LLToggleableMenu* getSortMenu() = 0;
+ virtual bool getTrashMenuVisible() = 0;
+
protected:
/**
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index 4ada9c445c..a24d6af033 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -482,10 +482,6 @@ LLPanelFace::~LLPanelFace()
void LLPanelFace::onVisibilityChange(bool new_visibility)
{
- if (new_visibility)
- {
- gAgent.showLatestFeatureNotification("gltf");
- }
LLPanel::onVisibilityChange(new_visibility);
}
@@ -3644,7 +3640,7 @@ void LLPanelFace::onCommitRepeatsPerMeter()
bool identical_scale_t = false;
LLSelectedTE::getObjectScaleS(obj_scale_s, identical_scale_s);
- LLSelectedTE::getObjectScaleS(obj_scale_t, identical_scale_t);
+ LLSelectedTE::getObjectScaleT(obj_scale_t, identical_scale_t);
if (gSavedSettings.getBOOL("SyncMaterialSettings"))
{
@@ -5151,6 +5147,7 @@ void LLPanelFace::LLSelectedTEMaterial::getMaxSpecularRepeats(F32& repeats, bool
LLMaterial* mat = object->getTE(face)->getMaterialParams().get();
U32 s_axis = VX;
U32 t_axis = VY;
+ LLPrimitive::getTESTAxes(face, &s_axis, &t_axis);
F32 repeats_s = 1.0f;
F32 repeats_t = 1.0f;
if (mat)
@@ -5175,6 +5172,7 @@ void LLPanelFace::LLSelectedTEMaterial::getMaxNormalRepeats(F32& repeats, bool&
LLMaterial* mat = object->getTE(face)->getMaterialParams().get();
U32 s_axis = VX;
U32 t_axis = VY;
+ LLPrimitive::getTESTAxes(face, &s_axis, &t_axis);
F32 repeats_s = 1.0f;
F32 repeats_t = 1.0f;
if (mat)
diff --git a/indra/newview/llpanelgroupcreate.cpp b/indra/newview/llpanelgroupcreate.cpp
index 4a370525ff..bc7b5caddf 100644
--- a/indra/newview/llpanelgroupcreate.cpp
+++ b/indra/newview/llpanelgroupcreate.cpp
@@ -85,6 +85,7 @@ bool LLPanelGroupCreate::postBuild()
mInsignia = getChild<LLTextureCtrl>("insignia", true);
mInsignia->setAllowLocalTexture(false);
+ mInsignia->setBakeTextureEnabled(false);
mInsignia->setCanApplyImmediately(false);
return true;
diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp
index 0c331b4cec..38ae818910 100644
--- a/indra/newview/llpanelgroupgeneral.cpp
+++ b/indra/newview/llpanelgroupgeneral.cpp
@@ -211,6 +211,7 @@ void LLPanelGroupGeneral::setupCtrls(LLPanel* panel_group)
{
mInsignia->setCommitCallback(onCommitAny, this);
mInsignia->setAllowLocalTexture(false);
+ mInsignia->setBakeTextureEnabled(false);
}
mFounderName = getChild<LLTextBox>("founder_name");
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index d964fa9170..3083bffdd4 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -68,6 +68,7 @@ const std::string FILTERS_FILENAME("filters.xml");
const std::string ALL_ITEMS("All Items");
const std::string RECENT_ITEMS("Recent Items");
const std::string WORN_ITEMS("Worn Items");
+const std::string FAVORITES("Favorites");
static LLPanelInjector<LLPanelMainInventory> t_inventory("panel_main_inventory");
@@ -196,6 +197,17 @@ bool LLPanelMainInventory::postBuild()
worn_filter.markDefault();
mWornItemsPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mWornItemsPanel, _1, _2));
}
+
+ LLInventoryPanel* favorites_panel = getChild<LLInventoryPanel>(FAVORITES);
+ if (favorites_panel)
+ {
+ favorites_panel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::DEFAULT_SORT_ORDER));
+ LLInventoryFilter& favorites_filter = favorites_panel->getFilter();
+ favorites_filter.setEmptyLookupMessage("InventoryNoMatchingFavorites");
+ favorites_filter.markDefault();
+ favorites_panel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, favorites_panel, _1, _2));
+ }
+
mSearchTypeCombo = getChild<LLComboBox>("search_type");
if(mSearchTypeCombo)
{
@@ -560,7 +572,8 @@ void LLPanelMainInventory::doCreate(const LLSD& userdata)
}
else
{
- menu_create_inventory_item(getPanel(), NULL, userdata);
+ selectAllItemsPanel();
+ menu_create_inventory_item(mAllItemsPanel, NULL, userdata);
}
}
diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp
index ef7986603b..f90d6d5b3f 100644
--- a/indra/newview/llpanelobjectinventory.cpp
+++ b/indra/newview/llpanelobjectinventory.cpp
@@ -129,6 +129,7 @@ public:
virtual void navigateToFolder(bool new_window = false, bool change_mode = false) {}
virtual bool isItemRenameable() const;
virtual bool renameItem(const std::string& new_name);
+ virtual bool isFavorite() const { return false; }
virtual bool isItemMovable() const;
virtual bool isItemRemovable(bool check_worn = true) const;
virtual bool removeItem();
@@ -1364,7 +1365,23 @@ bool LLPanelObjectInventory::postBuild()
void LLPanelObjectInventory::doToSelected(const LLSD& userdata)
{
- LLInventoryAction::doToSelected(&gInventory, mFolders, userdata.asString());
+ std::string action = userdata.asString();
+ if ("rename" == action || "delete" == action)
+ {
+ LLViewerObject* objectp = gObjectList.findObject(mTaskUUID);
+ if (objectp && !objectp->permModify())
+ {
+ LLNotificationsUtil::add("CantModifyContentInNoModTask");
+ }
+ else
+ {
+ LLInventoryAction::doToSelected(&gInventory, mFolders, action);
+ }
+ }
+ else
+ {
+ LLInventoryAction::doToSelected(&gInventory, mFolders, action);
+ }
}
void LLPanelObjectInventory::clearContents()
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp
index 4cd4afaa5a..a9e860d2ef 100644
--- a/indra/newview/llpaneloutfitedit.cpp
+++ b/indra/newview/llpaneloutfitedit.cpp
@@ -404,7 +404,9 @@ LLPanelOutfitEdit::LLPanelOutfitEdit()
mWearableListManager(NULL),
mPlusBtn(NULL),
mWearablesGearMenuBtn(NULL),
- mGearMenuBtn(NULL)
+ mGearMenuBtn(NULL),
+ mStatus(NULL),
+ mCurrentOutfitName(NULL)
{
mSavedFolderState = new LLSaveFolderState();
mSavedFolderState->setApply(false);
diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp
index 47c02793a3..e2e2cf1a61 100644
--- a/indra/newview/llpaneloutfitsinventory.cpp
+++ b/indra/newview/llpaneloutfitsinventory.cpp
@@ -33,6 +33,7 @@
#include "llfloatersidepanelcontainer.h"
#include "llinventoryfunctions.h"
#include "llinventorymodelbackgroundfetch.h"
+#include "llmenubutton.h"
#include "llnotificationsutil.h"
#include "lloutfitgallery.h"
#include "lloutfitobserver.h"
@@ -53,12 +54,17 @@ static const std::string SAVE_BTN("save_btn");
static LLPanelInjector<LLPanelOutfitsInventory> t_inventory("panel_outfits_inventory");
-LLPanelOutfitsInventory::LLPanelOutfitsInventory() :
- mMyOutfitsPanel(NULL),
- mCurrentOutfitPanel(NULL),
- mActivePanel(NULL),
- mAppearanceTabs(NULL),
- mInitialized(false)
+LLPanelOutfitsInventory::LLPanelOutfitsInventory()
+ : mMyOutfitsPanel(nullptr)
+ , mCurrentOutfitPanel(nullptr)
+ , mActivePanel(nullptr)
+ , mAppearanceTabs(nullptr)
+ , mInitialized(false)
+ , mGearMenu(nullptr)
+ , mSortMenu(nullptr)
+ , mTrashBtn(nullptr)
+ , mSortMenuPanel(nullptr)
+ , mTrashMenuPanel(nullptr)
{
gAgentWearables.addLoadedCallback(boost::bind(&LLPanelOutfitsInventory::onWearablesLoaded, this));
gAgentWearables.addLoadingStartedCallback(boost::bind(&LLPanelOutfitsInventory::onWearablesLoading, this));
@@ -75,6 +81,9 @@ LLPanelOutfitsInventory::~LLPanelOutfitsInventory()
{
gSavedSettings.setS32("LastAppearanceTab", mAppearanceTabs->getCurrentPanelIndex());
}
+ mGearMenuConnection.disconnect();
+ mSortMenuConnection.disconnect();
+ mTrashMenuConnection.disconnect();
}
// virtual
@@ -258,6 +267,22 @@ void LLPanelOutfitsInventory::initListCommandsHandlers()
mOutfitGalleryPanel->childSetAction("trash_btn", boost::bind(&LLPanelOutfitsInventory::onTrashButtonClick, this));
}
+void LLPanelOutfitsInventory::setMenuButtons(LLMenuButton* gear_menu, LLMenuButton* sort_menu, LLButton* trash_btn, LLPanel* sort_menu_panel, LLPanel* trash_menu_panel)
+{
+ mGearMenu = gear_menu;
+ mSortMenu = sort_menu;
+ mTrashBtn = trash_btn;
+ mSortMenuPanel = sort_menu_panel;
+ mTrashMenuPanel = trash_menu_panel;
+
+ mGearMenuConnection.disconnect();
+ mSortMenuConnection.disconnect();
+ mTrashMenuConnection.disconnect();
+ mGearMenuConnection = mGearMenu->setMouseDownCallback(boost::bind(&LLPanelOutfitsInventory::onGearMouseDown, this));
+ mSortMenuConnection = mSortMenu->setMouseDownCallback(boost::bind(&LLPanelOutfitsInventory::onGearMouseDown, this));
+ mTrashMenuConnection = mTrashBtn->setClickedCallback(boost::bind(&LLPanelOutfitsInventory::onTrashButtonClick, this));
+}
+
void LLPanelOutfitsInventory::updateListCommands()
{
bool trash_enabled = isActionEnabled("delete");
@@ -284,6 +309,14 @@ void LLPanelOutfitsInventory::onTrashButtonClick()
}
}
+void LLPanelOutfitsInventory::onGearMouseDown()
+{
+ if (mActivePanel)
+ {
+ mActivePanel->updateMenuItemsVisibility();
+ }
+}
+
bool LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata)
{
return mActivePanel && mActivePanel->isActionEnabled(userdata);
@@ -320,6 +353,28 @@ void LLPanelOutfitsInventory::onTabChange()
mActivePanel->checkFilterSubString();
mActivePanel->onOpen(LLSD());
+ if (mGearMenu)
+ {
+ mGearMenu->setMenu(mActivePanel->getGearMenu(), LLMenuButton::MP_BOTTOM_LEFT);
+ }
+ if (mSortMenu && mSortMenuPanel)
+ {
+ LLToggleableMenu* menu = mActivePanel->getSortMenu();
+ if (menu)
+ {
+ mSortMenu->setMenu(menu, LLMenuButton::MP_BOTTOM_LEFT);
+ mSortMenuPanel->setVisible(true);
+ }
+ else
+ {
+ mSortMenuPanel->setVisible(false);
+ }
+ }
+ if (mTrashMenuPanel)
+ {
+ mTrashMenuPanel->setVisible(mActivePanel->getTrashMenuVisible());
+ }
+
updateVerbs();
}
diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h
index e046681e95..29f7eb44f7 100644
--- a/indra/newview/llpaneloutfitsinventory.h
+++ b/indra/newview/llpaneloutfitsinventory.h
@@ -30,11 +30,13 @@
#include "llpanel.h"
+class LLButton;
class LLOutfitGallery;
class LLOutfitsList;
class LLOutfitListGearMenuBase;
class LLPanelAppearanceTab;
class LLPanelWearing;
+class LLMenuButton;
class LLMenuGL;
class LLSidepanelAppearance;
class LLTabContainer;
@@ -63,6 +65,13 @@ public:
bool isCOFPanelActive() const;
+ void setMenuButtons(
+ LLMenuButton* gear_menu,
+ LLMenuButton* sort_menu,
+ LLButton* trash_btn,
+ LLPanel* sort_menu_panel,
+ LLPanel* trash_menu_panel);
+
protected:
void updateVerbs();
@@ -92,20 +101,29 @@ protected:
void initListCommandsHandlers();
void updateListCommands();
void onWearButtonClick();
- void showGearMenu();
void onTrashButtonClick();
+ void onGearMouseDown();
bool isActionEnabled(const LLSD& userdata);
void setWearablesLoading(bool val);
void onWearablesLoaded();
void onWearablesLoading();
private:
LLPanel* mListCommands;
- LLMenuGL* mMenuAdd;
LLButton* mWearBtn = nullptr;
// List Commands //
//////////////////////////////////////////////////////////////////////////////////
bool mInitialized;
+
+ // not owned items
+ LLMenuButton* mGearMenu;
+ LLMenuButton* mSortMenu;
+ LLButton* mTrashBtn;
+ LLPanel* mSortMenuPanel;
+ LLPanel* mTrashMenuPanel;
+ boost::signals2::connection mGearMenuConnection;
+ boost::signals2::connection mSortMenuConnection;
+ boost::signals2::connection mTrashMenuConnection;
};
#endif //LL_LLPANELOUTFITSINVENTORY_H
diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp
index 04b8af49c1..6966cb38ab 100644
--- a/indra/newview/llpanelpeoplemenus.cpp
+++ b/indra/newview/llpanelpeoplemenus.cpp
@@ -351,7 +351,10 @@ void PeopleContextMenu::eject()
avatar = (LLVOAvatar*) object;
}
}
- if (!avatar) return;
+
+ if (!avatar)
+ return;
+
LLSD payload;
payload["avatar_id"] = avatar->getID();
std::string fullname = avatar->getFullname();
diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp
index 0ce1f0f9d3..891896076a 100644
--- a/indra/newview/llpanelpermissions.cpp
+++ b/indra/newview/llpanelpermissions.cpp
@@ -176,7 +176,7 @@ bool LLPanelPermissions::postBuild()
childSetCommitCallback("sale type",LLPanelPermissions::onCommitSaleType,this);
- childSetCommitCallback("Edit Cost", LLPanelPermissions::onCommitSaleInfo, this);
+ childSetCommitCallback("Edit Cost", LLPanelPermissions::onCommitSalePrice, this);
childSetCommitCallback("checkbox next owner can modify",LLPanelPermissions::onCommitNextOwnerModify,this);
childSetCommitCallback("checkbox next owner can copy",LLPanelPermissions::onCommitNextOwnerCopy,this);
@@ -781,7 +781,9 @@ void LLPanelPermissions::refresh()
if (has_change_sale_ability && (owner_mask_on & PERM_TRANSFER))
{
- getChildView("checkbox for sale")->setEnabled(can_transfer || (!can_transfer && num_for_sale));
+ bool change_sale_allowed = can_transfer || (!can_transfer && num_for_sale);
+ getChildView("checkbox for sale")->setEnabled(change_sale_allowed);
+ getChildView("Edit Cost")->setEnabled(change_sale_allowed && !is_for_sale_mixed);
// Set the checkbox to tentative if the prices of each object selected
// are not the same.
getChild<LLUICtrl>("checkbox for sale")->setTentative( is_for_sale_mixed);
@@ -1223,6 +1225,16 @@ void LLPanelPermissions::onCommitSaleType(LLUICtrl*, void* data)
self->setAllSaleInfo();
}
+void LLPanelPermissions::onCommitSalePrice(LLUICtrl *, void *data)
+{
+ LLPanelPermissions *self = (LLPanelPermissions *) data;
+ LLCheckBoxCtrl *checkPurchase = self->getChild<LLCheckBoxCtrl>("checkbox for sale");
+ if (checkPurchase && checkPurchase->get())
+ {
+ self->setAllSaleInfo();
+ }
+}
+
void LLPanelPermissions::setAllSaleInfo()
{
LL_INFOS() << "LLPanelPermissions::setAllSaleInfo()" << LL_ENDL;
diff --git a/indra/newview/llpanelpermissions.h b/indra/newview/llpanelpermissions.h
index 77129434ed..12e88361c9 100644
--- a/indra/newview/llpanelpermissions.h
+++ b/indra/newview/llpanelpermissions.h
@@ -77,6 +77,7 @@ protected:
static void onCommitSaleInfo(LLUICtrl* ctrl, void* data);
static void onCommitSaleType(LLUICtrl* ctrl, void* data);
+ static void onCommitSalePrice(LLUICtrl *ctrl, void *data);
void setAllSaleInfo();
static void onCommitClickAction(LLUICtrl* ctrl, void*);
diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp
index 7b562337a3..b1c8b5f36a 100644
--- a/indra/newview/llpanelprimmediacontrols.cpp
+++ b/indra/newview/llpanelprimmediacontrols.cpp
@@ -777,7 +777,7 @@ void LLPanelPrimMediaControls::draw()
else if(mFadeTimer.getStarted())
{
F32 time = mFadeTimer.getElapsedTimeF32();
- alpha *= llmax(lerp(1.0f, 0.0f, time / mControlFadeTime), 0.0f);
+ alpha *= llmax(lerp(1.f, 0.f, time / mControlFadeTime), 0.0f);
if(time >= mControlFadeTime)
{
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
index 132098ba99..cc418b6374 100644
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -2071,6 +2071,7 @@ void LLPanelProfileFirstLife::onChangePhoto()
}
});
texture_floaterp->setLocalTextureEnabled(false);
+ texture_floaterp->setBakeTextureEnabled(false);
texture_floaterp->setCanApply(false, true, false);
parent_floater->addDependentFloater(mFloaterTexturePickerHandle);
diff --git a/indra/newview/llpanelprofileclassifieds.h b/indra/newview/llpanelprofileclassifieds.h
index 42cd5f8975..2e6b7c4428 100644
--- a/indra/newview/llpanelprofileclassifieds.h
+++ b/indra/newview/llpanelprofileclassifieds.h
@@ -157,17 +157,17 @@ public:
void setParcelId(const LLUUID& id) { mParcelId = id; }
- LLUUID getParcelId() { return mParcelId; }
+ LLUUID getParcelId() const { return mParcelId; }
void setSimName(const std::string& sim_name) { mSimName = sim_name; }
- std::string getSimName() { return mSimName; }
+ std::string getSimName() const { return mSimName; }
void setFromSearch(bool val) { mFromSearch = val; }
- bool fromSearch() { return mFromSearch; }
+ bool fromSearch() const { return mFromSearch; }
- bool getInfoLoaded() { return mInfoLoaded; }
+ bool getInfoLoaded() const { return mInfoLoaded; }
void setInfoLoaded(bool loaded) { mInfoLoaded = loaded; }
@@ -175,9 +175,9 @@ public:
void resetDirty() override;
- bool isNew() { return mIsNew; }
+ bool isNew() const { return mIsNew; }
- bool isNewWithErrors() { return mIsNewWithErrors; }
+ bool isNewWithErrors() const { return mIsNewWithErrors; }
bool canClose();
@@ -191,10 +191,10 @@ public:
bool getAutoRenew();
- S32 getPriceForListing() { return mPriceForListing; }
+ S32 getPriceForListing() const { return mPriceForListing; }
void setEditMode(bool edit_mode);
- bool getEditMode() {return mEditMode;}
+ bool getEditMode() const { return mEditMode; }
static void setClickThrough(
const LLUUID& classified_id,
diff --git a/indra/newview/llpanelsnapshot.cpp b/indra/newview/llpanelsnapshot.cpp
index 32c9f6f402..56c0294dbe 100644
--- a/indra/newview/llpanelsnapshot.cpp
+++ b/indra/newview/llpanelsnapshot.cpp
@@ -37,6 +37,7 @@
// newview
#include "llsidetraypanelcontainer.h"
+#include "llsnapshotlivepreview.h"
#include "llviewercontrol.h" // gSavedSettings
#include "llagentbenefits.h"
@@ -99,6 +100,17 @@ void LLPanelSnapshot::onOpen(const LLSD& key)
{
getParentByType<LLFloater>()->notify(LLSD().with("image-format-change", true));
}
+
+ // If resolution is set to "Current Window", force a snapshot update
+ // each time a snapshot panel is opened to determine the correct
+ // image size (and upload fee) depending on the snapshot type.
+ if (mSnapshotFloater && getChild<LLUICtrl>(getImageSizeComboName())->getValue().asString() == "[i0,i0]")
+ {
+ if (LLSnapshotLivePreview* preview = mSnapshotFloater->getPreviewView())
+ {
+ preview->mForceUpdateSnapshot = true;
+ }
+ }
}
LLSnapshotModel::ESnapshotFormat LLPanelSnapshot::getImageFormat() const
diff --git a/indra/newview/llpanelsnapshotinventory.cpp b/indra/newview/llpanelsnapshotinventory.cpp
index 96b17acc40..b81b891685 100644
--- a/indra/newview/llpanelsnapshotinventory.cpp
+++ b/indra/newview/llpanelsnapshotinventory.cpp
@@ -42,77 +42,35 @@
/**
* The panel provides UI for saving snapshot as an inventory texture.
*/
-class LLPanelSnapshotInventoryBase
- : public LLPanelSnapshot
-{
- LOG_CLASS(LLPanelSnapshotInventoryBase);
-
-public:
- LLPanelSnapshotInventoryBase();
-
- /*virtual*/ bool postBuild();
-protected:
- void onSend();
- /*virtual*/ LLSnapshotModel::ESnapshotType getSnapshotType();
-};
-
class LLPanelSnapshotInventory
- : public LLPanelSnapshotInventoryBase
+ : public LLPanelSnapshot
{
LOG_CLASS(LLPanelSnapshotInventory);
public:
LLPanelSnapshotInventory();
- /*virtual*/ bool postBuild();
- /*virtual*/ void onOpen(const LLSD& key);
+ bool postBuild() override;
+ void onOpen(const LLSD& key) override;
void onResolutionCommit(LLUICtrl* ctrl);
private:
- /*virtual*/ std::string getWidthSpinnerName() const { return "inventory_snapshot_width"; }
- /*virtual*/ std::string getHeightSpinnerName() const { return "inventory_snapshot_height"; }
- /*virtual*/ std::string getAspectRatioCBName() const { return "inventory_keep_aspect_check"; }
- /*virtual*/ std::string getImageSizeComboName() const { return "texture_size_combo"; }
- /*virtual*/ std::string getImageSizePanelName() const { return LLStringUtil::null; }
- /*virtual*/ void updateControls(const LLSD& info);
-
-};
-
-class LLPanelOutfitSnapshotInventory
- : public LLPanelSnapshotInventoryBase
-{
- LOG_CLASS(LLPanelOutfitSnapshotInventory);
-
-public:
- LLPanelOutfitSnapshotInventory();
- /*virtual*/ bool postBuild();
- /*virtual*/ void onOpen(const LLSD& key);
+ std::string getWidthSpinnerName() const override { return "inventory_snapshot_width"; }
+ std::string getHeightSpinnerName() const override { return "inventory_snapshot_height"; }
+ std::string getAspectRatioCBName() const override { return "inventory_keep_aspect_check"; }
+ std::string getImageSizeComboName() const override { return "texture_size_combo"; }
+ std::string getImageSizePanelName() const override { return LLStringUtil::null; }
+ LLSnapshotModel::ESnapshotType getSnapshotType() override;
+ void updateControls(const LLSD& info) override;
-private:
- /*virtual*/ std::string getWidthSpinnerName() const { return ""; }
- /*virtual*/ std::string getHeightSpinnerName() const { return ""; }
- /*virtual*/ std::string getAspectRatioCBName() const { return ""; }
- /*virtual*/ std::string getImageSizeComboName() const { return "texture_size_combo"; }
- /*virtual*/ std::string getImageSizePanelName() const { return LLStringUtil::null; }
- /*virtual*/ void updateControls(const LLSD& info);
-
- /*virtual*/ void cancel();
+ void onSend();
+ void updateUploadCost();
+ S32 calculateUploadCost();
};
static LLPanelInjector<LLPanelSnapshotInventory> panel_class1("llpanelsnapshotinventory");
-static LLPanelInjector<LLPanelOutfitSnapshotInventory> panel_class2("llpaneloutfitsnapshotinventory");
-
-LLPanelSnapshotInventoryBase::LLPanelSnapshotInventoryBase()
-{
-}
-
-bool LLPanelSnapshotInventoryBase::postBuild()
-{
- return LLPanelSnapshot::postBuild();
-}
-
-LLSnapshotModel::ESnapshotType LLPanelSnapshotInventoryBase::getSnapshotType()
+LLSnapshotModel::ESnapshotType LLPanelSnapshotInventory::getSnapshotType()
{
return LLSnapshotModel::SNAPSHOT_TEXTURE;
}
@@ -130,12 +88,14 @@ bool LLPanelSnapshotInventory::postBuild()
getChild<LLSpinCtrl>(getHeightSpinnerName())->setAllowEdit(false);
getChild<LLUICtrl>(getImageSizeComboName())->setCommitCallback(boost::bind(&LLPanelSnapshotInventory::onResolutionCommit, this, _1));
- return LLPanelSnapshotInventoryBase::postBuild();
+ return LLPanelSnapshot::postBuild();
}
// virtual
void LLPanelSnapshotInventory::onOpen(const LLSD& key)
{
+ updateUploadCost();
+
LLPanelSnapshot::onOpen(key);
}
@@ -144,6 +104,8 @@ void LLPanelSnapshotInventory::updateControls(const LLSD& info)
{
const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true;
getChild<LLUICtrl>("save_btn")->setEnabled(have_snapshot);
+
+ updateUploadCost();
}
void LLPanelSnapshotInventory::onResolutionCommit(LLUICtrl* ctrl)
@@ -153,21 +115,9 @@ void LLPanelSnapshotInventory::onResolutionCommit(LLUICtrl* ctrl)
getChild<LLSpinCtrl>(getHeightSpinnerName())->setVisible(!current_window_selected);
}
-void LLPanelSnapshotInventoryBase::onSend()
+void LLPanelSnapshotInventory::onSend()
{
- S32 w = 0;
- S32 h = 0;
-
- if( mSnapshotFloater )
- {
- LLSnapshotLivePreview* preview = mSnapshotFloater->getPreviewView();
- if( preview )
- {
- preview->getSize(w, h);
- }
- }
-
- S32 expected_upload_cost = LLAgentBenefitsMgr::current().getTextureUploadCost(w, h);
+ S32 expected_upload_cost = calculateUploadCost();
if (can_afford_transaction(expected_upload_cost))
{
if (mSnapshotFloater)
@@ -188,36 +138,24 @@ void LLPanelSnapshotInventoryBase::onSend()
}
}
-LLPanelOutfitSnapshotInventory::LLPanelOutfitSnapshotInventory()
+void LLPanelSnapshotInventory::updateUploadCost()
{
- mCommitCallbackRegistrar.add("Inventory.SaveOutfitPhoto", boost::bind(&LLPanelOutfitSnapshotInventory::onSend, this));
- mCommitCallbackRegistrar.add("Inventory.SaveOutfitCancel", boost::bind(&LLPanelOutfitSnapshotInventory::cancel, this));
+ getChild<LLUICtrl>("hint_lbl")->setTextArg("[UPLOAD_COST]", llformat("%d", calculateUploadCost()));
}
-// virtual
-bool LLPanelOutfitSnapshotInventory::postBuild()
+S32 LLPanelSnapshotInventory::calculateUploadCost()
{
- return LLPanelSnapshotInventoryBase::postBuild();
-}
-
-// virtual
-void LLPanelOutfitSnapshotInventory::onOpen(const LLSD& key)
-{
- getChild<LLUICtrl>("hint_lbl")->setTextArg("[UPLOAD_COST]", llformat("%d", LLAgentBenefitsMgr::current().getTextureUploadCost()));
- LLPanelSnapshot::onOpen(key);
-}
-
-// virtual
-void LLPanelOutfitSnapshotInventory::updateControls(const LLSD& info)
-{
- const bool have_snapshot = info.has("have-snapshot") ? info["have-snapshot"].asBoolean() : true;
- getChild<LLUICtrl>("save_btn")->setEnabled(have_snapshot);
-}
+ S32 w = 0;
+ S32 h = 0;
-void LLPanelOutfitSnapshotInventory::cancel()
-{
if (mSnapshotFloater)
{
- mSnapshotFloater->closeFloater();
+ if (LLSnapshotLivePreview* preview = mSnapshotFloater->getPreviewView())
+ {
+ w = preview->getEncodedImageWidth();
+ h = preview->getEncodedImageHeight();
+ }
}
+
+ return LLAgentBenefitsMgr::current().getTextureUploadCost(w, h);
}
diff --git a/indra/newview/llpanelsnapshotlocal.cpp b/indra/newview/llpanelsnapshotlocal.cpp
index 366030c0fa..57759fbcaa 100644
--- a/indra/newview/llpanelsnapshotlocal.cpp
+++ b/indra/newview/llpanelsnapshotlocal.cpp
@@ -47,18 +47,18 @@ class LLPanelSnapshotLocal
public:
LLPanelSnapshotLocal();
- /*virtual*/ bool postBuild();
- /*virtual*/ void onOpen(const LLSD& key);
+ bool postBuild() override;
+ void onOpen(const LLSD& key) override;
private:
- /*virtual*/ std::string getWidthSpinnerName() const { return "local_snapshot_width"; }
- /*virtual*/ std::string getHeightSpinnerName() const { return "local_snapshot_height"; }
- /*virtual*/ std::string getAspectRatioCBName() const { return "local_keep_aspect_check"; }
- /*virtual*/ std::string getImageSizeComboName() const { return "local_size_combo"; }
- /*virtual*/ std::string getImageSizePanelName() const { return "local_image_size_lp"; }
- /*virtual*/ LLSnapshotModel::ESnapshotFormat getImageFormat() const;
- /*virtual*/ LLSnapshotModel::ESnapshotType getSnapshotType();
- /*virtual*/ void updateControls(const LLSD& info);
+ std::string getWidthSpinnerName() const override { return "local_snapshot_width"; }
+ std::string getHeightSpinnerName() const override { return "local_snapshot_height"; }
+ std::string getAspectRatioCBName() const override { return "local_keep_aspect_check"; }
+ std::string getImageSizeComboName() const override { return "local_size_combo"; }
+ std::string getImageSizePanelName() const override { return "local_image_size_lp"; }
+ LLSnapshotModel::ESnapshotFormat getImageFormat() const override;
+ LLSnapshotModel::ESnapshotType getSnapshotType() override;
+ void updateControls(const LLSD& info) override;
S32 mLocalFormat;
diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp
index 962d3bba16..05cd9e7b3a 100644
--- a/indra/newview/llpanelsnapshotoptions.cpp
+++ b/indra/newview/llpanelsnapshotoptions.cpp
@@ -30,12 +30,8 @@
#include "llsidetraypanelcontainer.h"
#include "llfloatersnapshot.h" // FIXME: create a snapshot model
-#include "llsnapshotlivepreview.h"
#include "llfloaterreg.h"
-#include "llagentbenefits.h"
-
-
/**
* Provides several ways to save a snapshot.
*/
@@ -46,12 +42,9 @@ class LLPanelSnapshotOptions
public:
LLPanelSnapshotOptions();
- ~LLPanelSnapshotOptions();
- /*virtual*/ bool postBuild();
- /*virtual*/ void onOpen(const LLSD& key);
+ bool postBuild() override;
private:
- void updateUploadCost();
void openPanel(const std::string& panel_name);
void onSaveToProfile();
void onSaveToEmail();
@@ -71,10 +64,6 @@ LLPanelSnapshotOptions::LLPanelSnapshotOptions()
mCommitCallbackRegistrar.add("Snapshot.SaveToComputer", boost::bind(&LLPanelSnapshotOptions::onSaveToComputer, this));
}
-LLPanelSnapshotOptions::~LLPanelSnapshotOptions()
-{
-}
-
// virtual
bool LLPanelSnapshotOptions::postBuild()
{
@@ -82,30 +71,6 @@ bool LLPanelSnapshotOptions::postBuild()
return LLPanel::postBuild();
}
-// virtual
-void LLPanelSnapshotOptions::onOpen(const LLSD& key)
-{
- updateUploadCost();
-}
-
-void LLPanelSnapshotOptions::updateUploadCost()
-{
- S32 w = 0;
- S32 h = 0;
-
- if( mSnapshotFloater )
- {
- LLSnapshotLivePreview* preview = mSnapshotFloater->getPreviewView();
- if( preview )
- {
- preview->getSize(w, h);
- }
- }
-
- S32 upload_cost = LLAgentBenefitsMgr::current().getTextureUploadCost(w, h);
- getChild<LLUICtrl>("save_to_inventory_btn")->setLabelArg("[AMOUNT]", llformat("%d", upload_cost));
-}
-
void LLPanelSnapshotOptions::openPanel(const std::string& panel_name)
{
LLSideTrayPanelContainer* parent = dynamic_cast<LLSideTrayPanelContainer*>(getParent());
diff --git a/indra/newview/llpanelsnapshotpostcard.cpp b/indra/newview/llpanelsnapshotpostcard.cpp
index 23e8789e3f..f3dfdc9250 100644
--- a/indra/newview/llpanelsnapshotpostcard.cpp
+++ b/indra/newview/llpanelsnapshotpostcard.cpp
@@ -56,18 +56,18 @@ class LLPanelSnapshotPostcard
public:
LLPanelSnapshotPostcard();
- /*virtual*/ bool postBuild();
- /*virtual*/ void onOpen(const LLSD& key);
+ bool postBuild() override;
+ void onOpen(const LLSD& key) override;
private:
- /*virtual*/ std::string getWidthSpinnerName() const { return "postcard_snapshot_width"; }
- /*virtual*/ std::string getHeightSpinnerName() const { return "postcard_snapshot_height"; }
- /*virtual*/ std::string getAspectRatioCBName() const { return "postcard_keep_aspect_check"; }
- /*virtual*/ std::string getImageSizeComboName() const { return "postcard_size_combo"; }
- /*virtual*/ std::string getImageSizePanelName() const { return "postcard_image_size_lp"; }
- /*virtual*/ LLSnapshotModel::ESnapshotFormat getImageFormat() const { return LLSnapshotModel::SNAPSHOT_FORMAT_JPEG; }
- /*virtual*/ LLSnapshotModel::ESnapshotType getSnapshotType();
- /*virtual*/ void updateControls(const LLSD& info);
+ std::string getWidthSpinnerName() const override { return "postcard_snapshot_width"; }
+ std::string getHeightSpinnerName() const override { return "postcard_snapshot_height"; }
+ std::string getAspectRatioCBName() const override { return "postcard_keep_aspect_check"; }
+ std::string getImageSizeComboName() const override { return "postcard_size_combo"; }
+ std::string getImageSizePanelName() const override { return "postcard_image_size_lp"; }
+ LLSnapshotModel::ESnapshotFormat getImageFormat() const override { return LLSnapshotModel::SNAPSHOT_FORMAT_JPEG; }
+ LLSnapshotModel::ESnapshotType getSnapshotType() override;
+ void updateControls(const LLSD& info) override;
bool missingSubjMsgAlertCallback(const LLSD& notification, const LLSD& response);
static void sendPostcardFinished(LLSD result);
diff --git a/indra/newview/llpanelsnapshotprofile.cpp b/indra/newview/llpanelsnapshotprofile.cpp
index aa257dea9e..b533d7bbbc 100644
--- a/indra/newview/llpanelsnapshotprofile.cpp
+++ b/indra/newview/llpanelsnapshotprofile.cpp
@@ -49,17 +49,17 @@ class LLPanelSnapshotProfile
public:
LLPanelSnapshotProfile();
- /*virtual*/ bool postBuild();
- /*virtual*/ void onOpen(const LLSD& key);
+ bool postBuild() override;
+ void onOpen(const LLSD& key) override;
private:
- /*virtual*/ std::string getWidthSpinnerName() const { return "profile_snapshot_width"; }
- /*virtual*/ std::string getHeightSpinnerName() const { return "profile_snapshot_height"; }
- /*virtual*/ std::string getAspectRatioCBName() const { return "profile_keep_aspect_check"; }
- /*virtual*/ std::string getImageSizeComboName() const { return "profile_size_combo"; }
- /*virtual*/ std::string getImageSizePanelName() const { return "profile_image_size_lp"; }
- /*virtual*/ LLSnapshotModel::ESnapshotFormat getImageFormat() const { return LLSnapshotModel::SNAPSHOT_FORMAT_PNG; }
- /*virtual*/ void updateControls(const LLSD& info);
+ std::string getWidthSpinnerName() const override { return "profile_snapshot_width"; }
+ std::string getHeightSpinnerName() const override { return "profile_snapshot_height"; }
+ std::string getAspectRatioCBName() const override { return "profile_keep_aspect_check"; }
+ std::string getImageSizeComboName() const override { return "profile_size_combo"; }
+ std::string getImageSizePanelName() const override { return "profile_image_size_lp"; }
+ LLSnapshotModel::ESnapshotFormat getImageFormat() const override { return LLSnapshotModel::SNAPSHOT_FORMAT_PNG; }
+ void updateControls(const LLSD& info) override;
void onSend();
};
diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp
index c1534c9abd..3aedde74c6 100644
--- a/indra/newview/llpanelwearing.cpp
+++ b/indra/newview/llpanelwearing.cpp
@@ -113,6 +113,7 @@ protected:
boost::bind(&LLAppearanceMgr::removeItemsFromAvatar, LLAppearanceMgr::getInstance(), mUUIDs, no_op));
registrar.add("Wearing.Detach",
boost::bind(&LLAppearanceMgr::removeItemsFromAvatar, LLAppearanceMgr::getInstance(), mUUIDs, no_op));
+ registrar.add("Wearing.Favorite", boost::bind(toggle_favorites, mUUIDs));
LLContextMenu* menu = createFromFile("menu_wearing_tab.xml");
updateMenuItemsVisibility(menu);
@@ -125,6 +126,8 @@ protected:
bool bp_selected = false; // true if body parts selected
bool clothes_selected = false;
bool attachments_selected = false;
+ bool can_favorite = false;
+ bool can_unfavorite = false;
// See what types of wearables are selected.
for (uuid_vec_t::const_iterator it = mUUIDs.begin(); it != mUUIDs.end(); ++it)
@@ -137,6 +140,9 @@ protected:
continue;
}
+ LLUUID linked_id = item->getLinkedUUID();
+ LLViewerInventoryItem* linked_item = gInventory.getItem(linked_id);
+
LLAssetType::EType type = item->getType();
if (type == LLAssetType::AT_CLOTHING)
{
@@ -150,6 +156,8 @@ protected:
{
attachments_selected = true;
}
+ can_favorite |= !linked_item->getIsFavorite();
+ can_unfavorite |= linked_item->getIsFavorite();
}
// Enable/disable some menu items depending on the selection.
@@ -166,6 +174,8 @@ protected:
menu->setItemVisible("detach", allow_detach);
menu->setItemVisible("edit_outfit_separator", show_touch | show_edit | allow_take_off || allow_detach);
menu->setItemVisible("show_original", mUUIDs.size() == 1);
+ menu->setItemVisible("favorites_add", can_favorite);
+ menu->setItemVisible("favorites_remove", can_unfavorite);
}
};
@@ -232,6 +242,10 @@ LLPanelWearing::~LLPanelWearing()
{
mAttachmentsChangedConnection.disconnect();
}
+ if (mGearMenuConnection.connected())
+ {
+ mGearMenuConnection.disconnect();
+ }
}
bool LLPanelWearing::postBuild()
@@ -249,10 +263,6 @@ bool LLPanelWearing::postBuild()
mTempItemsList->setFgUnselectedColor(LLColor4::white);
mTempItemsList->setRightMouseDownCallback(boost::bind(&LLPanelWearing::onTempAttachmentsListRightClick, this, _1, _2, _3));
- LLMenuButton* menu_gear_btn = getChild<LLMenuButton>("options_gear_btn");
-
- menu_gear_btn->setMenu(mGearMenu->getMenu());
-
return true;
}
@@ -560,6 +570,16 @@ void LLPanelWearing::onRemoveAttachment()
}
}
+LLToggleableMenu* LLPanelWearing::getGearMenu()
+{
+ return mGearMenu->getMenu();
+}
+
+LLToggleableMenu* LLPanelWearing::getSortMenu()
+{
+ return NULL;
+}
+
void LLPanelWearing::onRemoveItem()
{
if (mWearablesTab->isExpanded())
diff --git a/indra/newview/llpanelwearing.h b/indra/newview/llpanelwearing.h
index ea0787d0ef..aa80a3fc21 100644
--- a/indra/newview/llpanelwearing.h
+++ b/indra/newview/llpanelwearing.h
@@ -84,6 +84,11 @@ public:
void onEditAttachment();
void onRemoveAttachment();
+ void updateMenuItemsVisibility() {};
+ LLToggleableMenu* getGearMenu();
+ LLToggleableMenu* getSortMenu();
+ bool getTrashMenuVisible() { return false; }
+
private:
void onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y);
void onTempAttachmentsListRightClick(LLUICtrl* ctrl, S32 x, S32 y);
@@ -93,6 +98,7 @@ private:
LLWearableItemsList* mCOFItemsList;
LLScrollListCtrl* mTempItemsList;
LLWearingGearMenu* mGearMenu;
+ boost::signals2::connection mGearMenuConnection;
LLListContextMenu* mContextMenu;
LLListContextMenu* mAttachmentsMenu;
diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp
index 86291708b0..e5c84728fe 100644
--- a/indra/newview/llphysicsmotion.cpp
+++ b/indra/newview/llphysicsmotion.cpp
@@ -646,18 +646,17 @@ bool LLPhysicsMotion::onUpdate(F32 time)
velocity_new_local = 0;
}
- // Check for NaN values. A NaN value is detected if the variables doesn't equal itself.
- // If NaN, then reset everything.
- if ((mPosition_local != mPosition_local) ||
- (mVelocity_local != mVelocity_local) ||
- (position_new_local != position_new_local))
+ // Check for NaN values. If NaN, then reset everything.
+ if (llisnan(mPosition_local) ||
+ llisnan(mVelocity_local) ||
+ llisnan(position_new_local))
{
- position_new_local = 0;
- mVelocity_local = 0;
- mVelocityJoint_local = 0;
- mAccelerationJoint_local = 0;
- mPosition_local = 0;
- mPosition_world = LLVector3(0,0,0);
+ position_new_local = 0.f;
+ mVelocity_local = 0.f;
+ mVelocityJoint_local = 0.f;
+ mAccelerationJoint_local = 0.f;
+ mPosition_local = 0.f;
+ mPosition_world = LLVector3(0.f,0.f,0.f);
}
const F32 position_new_local_clamped = llclamp(position_new_local,
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 02a4c7fb26..c2aa4925bd 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -703,9 +703,10 @@ void LLScriptEdCore::sync()
}
}
-bool LLScriptEdCore::hasChanged()
+bool LLScriptEdCore::hasChanged() const
{
- if (!mEditor) return false;
+ if (!mEditor)
+ return false;
return ((!mEditor->isPristine() || mEnableSave) && mHasScriptData);
}
diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h
index 70ee1a4274..0bbe540207 100644
--- a/indra/newview/llpreviewscript.h
+++ b/indra/newview/llpreviewscript.h
@@ -143,7 +143,7 @@ public:
void setItemRemoved(bool script_removed){mScriptRemoved = script_removed;};
void setAssetID( const LLUUID& asset_id){ mAssetID = asset_id; };
- LLUUID getAssetID() { return mAssetID; }
+ LLUUID getAssetID() const { return mAssetID; }
bool isFontSizeChecked(const LLSD &userdata);
void onChangeFontSize(const LLSD &size_name);
@@ -155,7 +155,7 @@ public:
void onBtnDynamicHelp();
void onBtnUndoChanges();
- bool hasChanged();
+ bool hasChanged() const;
void selectFirstError();
@@ -211,7 +211,6 @@ class LLScriptEdContainer : public LLPreview
public:
LLScriptEdContainer(const LLSD& key);
- LLScriptEdContainer(const LLSD& key, const bool live);
bool handleKeyHere(KEY key, MASK mask);
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 1876cd3086..dfc592453a 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -252,6 +252,7 @@ LLSelectMgr::LLSelectMgr()
LLSelectMgr::~LLSelectMgr()
{
clearSelections();
+ mSlectionLodModChangedConnection.disconnect();
}
void LLSelectMgr::clearSelections()
diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h
index 0dbdc133e3..f797ed9bd3 100644
--- a/indra/newview/llselectmgr.h
+++ b/indra/newview/llselectmgr.h
@@ -941,6 +941,7 @@ private:
bool mForceSelection;
std::vector<LLAnimPauseRequest> mPauseRequests;
+ boost::signals2::connection mSlectionLodModChangedConnection;
};
// *DEPRECATED: For callbacks or observers, use
diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp
index c618483fc4..1d1b31d2a6 100644
--- a/indra/newview/llsidepanelappearance.cpp
+++ b/indra/newview/llsidepanelappearance.cpp
@@ -40,6 +40,7 @@
#include "llfloaterworldmap.h"
#include "llfolderviewmodel.h"
#include "llloadingindicator.h"
+#include "llmenubutton.h"
#include "lloutfitobserver.h"
#include "llpaneleditwearable.h"
#include "llpaneloutfitsinventory.h"
@@ -145,6 +146,14 @@ bool LLSidepanelAppearance::postBuild()
setWearablesLoading(gAgentWearables.isCOFChangeInProgress());
+
+ LLMenuButton* menu_gear_btn = getChild<LLMenuButton>("options_gear_btn");
+ LLMenuButton* menu_sort_btn = getChild<LLMenuButton>("sorting_menu_btn");
+ LLButton* menu_trash_btn = getChild<LLButton>("trash_btn");
+ LLPanel* menu_sort_btn_panel = getChild<LLPanel>("options_sort_btn_panel");
+ LLPanel* menu_trash_btn_panel = getChild<LLPanel>("trash_btn_panel");
+ mPanelOutfitsInventory->setMenuButtons(menu_gear_btn, menu_sort_btn, menu_trash_btn, menu_sort_btn_panel, menu_trash_btn_panel);
+
return true;
}
diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp
index fccf745a74..3d4b4fb9c1 100644
--- a/indra/newview/llsidepaneliteminfo.cpp
+++ b/indra/newview/llsidepaneliteminfo.cpp
@@ -56,6 +56,8 @@
#include "llviewerregion.h"
+const char* const DEFAULT_DESC = "(No Description)";
+
class PropertiesChangedCallback : public LLInventoryCallback
{
public:
@@ -128,6 +130,7 @@ LLSidepanelItemInfo::LLSidepanelItemInfo(const LLPanel::Params& p)
, mUpdatePendingId(-1)
, mIsDirty(false) /*Not ready*/
, mParentFloater(NULL)
+ , mLabelItemDesc(NULL)
{
gInventory.addObserver(this);
gIdleCallbacks.addFunction(&LLSidepanelItemInfo::onIdle, (void*)this);
@@ -158,10 +161,11 @@ bool LLSidepanelItemInfo::postBuild()
mItemTypeIcon = getChild<LLIconCtrl>("item_type_icon");
mLabelOwnerName = getChild<LLTextBox>("LabelOwnerName");
mLabelCreatorName = getChild<LLTextBox>("LabelCreatorName");
+ mLabelItemDesc = getChild<LLTextEditor>("LabelItemDesc");
getChild<LLLineEditor>("LabelItemName")->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe);
getChild<LLUICtrl>("LabelItemName")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onCommitName,this));
- getChild<LLUICtrl>("LabelItemDesc")->setCommitCallback(boost::bind(&LLSidepanelItemInfo:: onCommitDescription, this));
+ mLabelItemDesc->setCommitCallback(boost::bind(&LLSidepanelItemInfo:: onCommitDescription, this));
// Thumnail edition
mChangeThumbnailBtn->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onEditThumbnail, this));
// acquired date
@@ -923,17 +927,22 @@ void LLSidepanelItemInfo::onCommitDescription()
LLViewerInventoryItem* item = findItem();
if(!item) return;
- LLTextEditor* labelItemDesc = getChild<LLTextEditor>("LabelItemDesc");
- if(!labelItemDesc)
+ if(!mLabelItemDesc)
+ {
+ return;
+ }
+ if (!gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), GP_OBJECT_MANIPULATE))
{
return;
}
- if((item->getDescription() != labelItemDesc->getText()) &&
- (gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), GP_OBJECT_MANIPULATE)))
+ std::string old_desc = item->getDescription();
+ std::string new_desc = mLabelItemDesc->getText();
+ if(old_desc != new_desc)
{
+ mLabelItemDesc->setSelectAllOnFocusReceived(false);
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
- new_item->setDescription(labelItemDesc->getText());
+ new_item->setDescription(new_desc);
onCommitChanges(new_item);
}
}
diff --git a/indra/newview/llsidepaneliteminfo.h b/indra/newview/llsidepaneliteminfo.h
index 718edc79d6..0895d3360c 100644
--- a/indra/newview/llsidepaneliteminfo.h
+++ b/indra/newview/llsidepaneliteminfo.h
@@ -46,6 +46,7 @@ class LLObjectInventoryObserver;
class LLViewerObject;
class LLPermissions;
class LLTextBox;
+class LLTextEditor;
class LLSidepanelItemInfo : public LLPanel, public LLInventoryObserver
{
@@ -105,6 +106,7 @@ private:
LLIconCtrl* mItemTypeIcon;
LLTextBox* mLabelOwnerName;
LLTextBox* mLabelCreatorName;
+ LLTextEditor* mLabelItemDesc;
//
// UI Elements
diff --git a/indra/newview/llskinningutil.cpp b/indra/newview/llskinningutil.cpp
index cee43f3cff..afa4686d52 100644
--- a/indra/newview/llskinningutil.cpp
+++ b/indra/newview/llskinningutil.cpp
@@ -116,8 +116,8 @@ void LLSkinningUtil::scrubInvalidJoints(LLVOAvatar *avatar, LLMeshSkinInfo* skin
// needed for handling of any legacy bad data.
if (!avatar->getJoint(skin->mJointNames[j]))
{
- LL_DEBUGS("Avatar") << avatar->getFullname() << " mesh rigged to invalid joint " << skin->mJointNames[j] << LL_ENDL;
- LL_WARNS_ONCE("Avatar") << avatar->getFullname() << " mesh rigged to invalid joint" << skin->mJointNames[j] << LL_ENDL;
+ LL_DEBUGS("Avatar") << avatar->getDebugName() << " mesh rigged to invalid joint " << skin->mJointNames[j] << LL_ENDL;
+ LL_WARNS_ONCE("Avatar") << avatar->getDebugName() << " mesh rigged to invalid joint" << skin->mJointNames[j] << LL_ENDL;
skin->mJointNames[j] = "mPelvis";
skin->mJointNumsInitialized = false; // force update after names change.
}
diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp
index ea95d71b27..7d5f380886 100644
--- a/indra/newview/llsnapshotlivepreview.cpp
+++ b/indra/newview/llsnapshotlivepreview.cpp
@@ -1066,7 +1066,7 @@ void LLSnapshotLivePreview::saveTexture(bool outfit_snapshot, std::string name)
tid, LLAssetType::AT_TEXTURE, res_name, res_desc, 0,
folder_type, inv_type,
PERM_ALL, LLFloaterPerms::getGroupPerms("Uploads"), LLFloaterPerms::getEveryonePerms("Uploads"),
- expected_upload_cost, !outfit_snapshot));
+ expected_upload_cost, LLUUID::null, !outfit_snapshot));
upload_new_resource(assetUploadInfo);
diff --git a/indra/newview/llteleporthistorystorage.cpp b/indra/newview/llteleporthistorystorage.cpp
index dd7c6aa9e3..e02f76711c 100644
--- a/indra/newview/llteleporthistorystorage.cpp
+++ b/indra/newview/llteleporthistorystorage.cpp
@@ -127,6 +127,12 @@ void LLTeleportHistoryStorage::addItem(const std::string title, const LLVector3d
S32 removed_index = -1;
if (item_iter != mItems.end())
{
+ // When teleporting via history it's possible that there can be
+ // an offset applied to the position, so each new teleport can
+ // be a meter higher than the last.
+ // Avoid it by preserving original position.
+ item.mGlobalPos = item_iter->mGlobalPos;
+
removed_index = (S32)(item_iter - mItems.begin());
mItems.erase(item_iter);
}
diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index 35057a910a..ff01e537ee 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -185,6 +185,7 @@ LLFloaterTexturePicker::LLFloaterTexturePicker(
mSetImageAssetIDCallback(NULL),
mOnUpdateImageStatsCallback(NULL),
mBakeTextureEnabled(false),
+ mLocalTextureEnabled(false),
mInventoryPickType(pick_type)
{
mCanApplyImmediately = can_apply_immediately;
@@ -524,6 +525,8 @@ bool LLFloaterTexturePicker::handleKeyHere(KEY key, MASK mask)
void LLFloaterTexturePicker::onOpen(const LLSD& key)
{
if (sLastPickerMode != 0
+ && (mLocalTextureEnabled || sLastPickerMode != 1)
+ && (mBakeTextureEnabled || sLastPickerMode != 2)
&& mModeSelector->selectByValue(sLastPickerMode))
{
changeMode();
@@ -1490,7 +1493,13 @@ void LLFloaterTexturePicker::refreshInventoryFilter()
void LLFloaterTexturePicker::setLocalTextureEnabled(bool enabled)
{
+ mLocalTextureEnabled = enabled;
mModeSelector->setEnabledByValue(1, enabled);
+ if (!enabled && (mModeSelector->getValue().asInteger() == 2))
+ {
+ mModeSelector->selectByValue(0);
+ onModeSelect(0, this);
+ }
}
void LLFloaterTexturePicker::setBakeTextureEnabled(bool enabled)
@@ -1877,11 +1886,9 @@ void LLTextureCtrl::showPicker(bool take_focus)
if (texture_floaterp)
{
texture_floaterp->setOnFloaterCommitCallback(boost::bind(&LLTextureCtrl::onFloaterCommit, this, _1, _2, _3, _4, _5));
- }
- if (texture_floaterp)
- {
texture_floaterp->setSetImageAssetIDCallback(boost::bind(&LLTextureCtrl::setImageAssetID, this, _1));
+ texture_floaterp->setLocalTextureEnabled(mAllowLocalTexture);
texture_floaterp->setBakeTextureEnabled(mBakeTextureEnabled && mInventoryPickType != PICK_MATERIAL);
}
@@ -1891,12 +1898,6 @@ void LLTextureCtrl::showPicker(bool take_focus)
floaterp->openFloater();
}
- LLFloaterTexturePicker* picker_floater = dynamic_cast<LLFloaterTexturePicker*>(floaterp);
- if (picker_floater)
- {
- picker_floater->setLocalTextureEnabled(mAllowLocalTexture);
- }
-
if (take_focus)
{
floaterp->setFocus(true);
@@ -2076,7 +2077,17 @@ void LLTextureCtrl::setOnTextureSelectedCallback(texture_selected_callback cb)
}
}
-void LLTextureCtrl::setImageAssetName(const std::string& name)
+void LLTextureCtrl::setAllowLocalTexture(bool b)
+{
+ mAllowLocalTexture = b;
+ LLFloaterTexturePicker* picker_floater = dynamic_cast<LLFloaterTexturePicker*>(mFloaterHandle.get());
+ if (picker_floater)
+ {
+ picker_floater->setLocalTextureEnabled(mAllowLocalTexture);
+ }
+}
+
+void LLTextureCtrl::setImageAssetName(const std::string& name)
{
LLPointer<LLUIImage> imagep = LLUI::getUIImage(name);
if(imagep)
diff --git a/indra/newview/lltexturectrl.h b/indra/newview/lltexturectrl.h
index df5e763139..581242cc53 100644
--- a/indra/newview/lltexturectrl.h
+++ b/indra/newview/lltexturectrl.h
@@ -181,7 +181,7 @@ public:
void setAllowNoTexture( bool b ) { mAllowNoTexture = b; }
bool getAllowNoTexture() const { return mAllowNoTexture; }
- void setAllowLocalTexture(bool b) { mAllowLocalTexture = b; }
+ void setAllowLocalTexture(bool b);
bool getAllowLocalTexture() const { return mAllowLocalTexture; }
const LLUUID& getImageItemID() { return mImageItemID; }
@@ -456,6 +456,7 @@ private:
set_on_update_image_stats_callback mOnUpdateImageStatsCallback;
bool mBakeTextureEnabled;
+ bool mLocalTextureEnabled;
static S32 sLastPickerMode;
};
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index 087761cbd0..cc187a1f98 100644
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -2484,7 +2484,7 @@ LLTextureFetch::~LLTextureFetch()
}
S32 LLTextureFetch::createRequest(FTType f_type, const std::string& url, const LLUUID& id, const LLHost& host, F32 priority,
- S32 w, S32 h, S32 c, S32 desired_discard, bool needs_aux, bool can_use_http)
+ S32 w, S32 h, S32 c, S32 desired_discard, bool needs_aux, bool can_use_http)
{
LL_PROFILE_ZONE_SCOPED;
if (mDebugPause)
@@ -2496,13 +2496,13 @@ S32 LLTextureFetch::createRequest(FTType f_type, const std::string& url, const L
{
LL_DEBUGS("Avatar") << " requesting " << id << " " << w << "x" << h << " discard " << desired_discard << " type " << f_type << LL_ENDL;
}
- LLTextureFetchWorker* worker = getWorker(id) ;
+ LLTextureFetchWorker* worker = getWorker(id);
if (worker)
{
if (worker->mHost != host)
{
LL_WARNS(LOG_TXT) << "LLTextureFetch::createRequest " << id << " called with multiple hosts: "
- << host << " != " << worker->mHost << LL_ENDL;
+ << host << " != " << worker->mHost << LL_ENDL;
removeRequest(worker, true);
worker = NULL;
return CREATE_REQUEST_ERROR_MHOSTS;
@@ -2538,7 +2538,7 @@ S32 LLTextureFetch::createRequest(FTType f_type, const std::string& url, const L
// we really do get it.)
desired_size = MAX_IMAGE_DATA_SIZE;
}
- else if (w*h*c > 0)
+ else if (w * h * c > 0)
{
// If the requester knows the dimensions of the image,
// this will calculate how much data we need without having to parse the header
@@ -2596,14 +2596,15 @@ S32 LLTextureFetch::createRequest(FTType f_type, const std::string& url, const L
worker->lockWorkMutex(); // +Mw
worker->mActiveCount++;
worker->mNeedsAux = needs_aux;
- worker->setCanUseHTTP(can_use_http) ;
+ worker->setCanUseHTTP(can_use_http);
worker->unlockWorkMutex(); // -Mw
}
LL_DEBUGS(LOG_TXT) << "REQUESTED: " << id << " f_type " << fttype_to_string(f_type)
- << " Discard: " << desired_discard << " size " << desired_size << LL_ENDL;
+ << " Discard: " << desired_discard << " size " << desired_size << LL_ENDL;
return desired_discard;
}
+
// Threads: T*
//
// protected
diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h
index 8ab90896dc..851d6c11a0 100644
--- a/indra/newview/lltexturefetch.h
+++ b/indra/newview/lltexturefetch.h
@@ -85,8 +85,9 @@ public:
};
// Threads: T* (but Tmain mostly)
+ // returns discard on success, fail code otherwise
S32 createRequest(FTType f_type, const std::string& url, const LLUUID& id, const LLHost& host, F32 priority,
- S32 w, S32 h, S32 c, S32 discard, bool needs_aux, bool can_use_http);
+ S32 w, S32 h, S32 c, S32 discard, bool needs_aux, bool can_use_http);
// Requests that a fetch operation be deleted from the queue.
// If @cancel is true, also stops any I/O operations pending.
diff --git a/indra/newview/llthumbnailctrl.cpp b/indra/newview/llthumbnailctrl.cpp
index ae21d3e733..b077262f06 100644
--- a/indra/newview/llthumbnailctrl.cpp
+++ b/indra/newview/llthumbnailctrl.cpp
@@ -111,7 +111,9 @@ void LLThumbnailCtrl::draw()
gl_draw_scaled_image( draw_rect.mLeft, draw_rect.mBottom, draw_rect.getWidth(), draw_rect.getHeight(), mTexturep, UI_VERTEX_COLOR % alpha);
- mTexturep->setKnownDrawSize(draw_rect.getWidth(), draw_rect.getHeight());
+ // Thumbnails are usually 256x256 or smaller, either report that or
+ // some high value to get image with higher priority
+ mTexturep->setKnownDrawSize(MAX_IMAGE_SIZE, MAX_IMAGE_SIZE);
}
else if( mImagep.notNull() )
{
@@ -238,12 +240,8 @@ void LLThumbnailCtrl::initImage()
{
// Should it support baked textures?
mTexturep = LLViewerTextureManager::getFetchedTexture(mImageAssetID, FTT_DEFAULT, MIPMAP_YES, LLGLTexture::BOOST_THUMBNAIL);
-
mTexturep->forceToSaveRawImage(0);
-
- S32 desired_draw_width = MAX_IMAGE_SIZE;
- S32 desired_draw_height = MAX_IMAGE_SIZE;
- mTexturep->setKnownDrawSize(desired_draw_width, desired_draw_height);
+ mTexturep->setKnownDrawSize(MAX_IMAGE_SIZE, MAX_IMAGE_SIZE);
}
}
else if (tvalue.isString())
diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp
index 84854a79d4..0f871dc1bb 100644
--- a/indra/newview/lltoast.cpp
+++ b/indra/newview/lltoast.cpp
@@ -421,7 +421,7 @@ void LLToast::setVisible(bool show)
if(mHideBtn)
mHideBtn->setVisible(show);
}
- LLFloater::setVisible(show);
+ LLModalDialog::setVisible(show);
if (mPanel
&& !mPanel->isDead()
&& mWrapperPanel
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index 9d6f44c096..83b0260425 100644
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -2156,7 +2156,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv(
{
if(mSource == SOURCE_LIBRARY)
{
- LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, (LLViewerJointAttachment*)0));
+ LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, (LLViewerJointAttachment*)0, false));
copy_inventory_item(
gAgent.getID(),
item->getPermissions().getOwner(),
@@ -2167,7 +2167,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv(
}
else
{
- rez_attachment(item, 0);
+ rez_attachment(item, 0, false);
}
}
return ACCEPT_YES_SINGLE;
diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp
index 7ef2c8d697..7d5386110d 100644
--- a/indra/newview/llviewerassetupload.cpp
+++ b/indra/newview/llviewerassetupload.cpp
@@ -62,7 +62,8 @@ LLResourceUploadInfo::LLResourceUploadInfo(LLTransactionID transactId,
LLAssetType::EType assetType, std::string name, std::string description,
S32 compressionInfo, LLFolderType::EType destinationType,
LLInventoryType::EType inventoryType, U32 nextOWnerPerms,
- U32 groupPerms, U32 everyonePerms, S32 expectedCost, bool showInventory) :
+ U32 groupPerms, U32 everyonePerms, S32 expectedCost,
+ const LLUUID& destFolderId, bool showInventory) :
mTransactionId(transactId),
mAssetType(assetType),
mName(name),
@@ -75,7 +76,7 @@ LLResourceUploadInfo::LLResourceUploadInfo(LLTransactionID transactId,
mEveryonePerms(everyonePerms),
mExpectedUploadCost(expectedCost),
mShowInventory(showInventory),
- mFolderId(LLUUID::null),
+ mFolderId(destFolderId),
mItemId(LLUUID::null),
mAssetId(LLAssetID::null)
{ }
@@ -84,7 +85,8 @@ LLResourceUploadInfo::LLResourceUploadInfo(LLTransactionID transactId,
LLResourceUploadInfo::LLResourceUploadInfo(std::string name,
std::string description, S32 compressionInfo,
LLFolderType::EType destinationType, LLInventoryType::EType inventoryType,
- U32 nextOWnerPerms, U32 groupPerms, U32 everyonePerms, S32 expectedCost, bool showInventory) :
+ U32 nextOWnerPerms, U32 groupPerms, U32 everyonePerms, S32 expectedCost,
+ const LLUUID& destFolderId, bool showInventory) :
mName(name),
mDescription(description),
mCompressionInfo(compressionInfo),
@@ -97,7 +99,7 @@ LLResourceUploadInfo::LLResourceUploadInfo(std::string name,
mShowInventory(showInventory),
mTransactionId(),
mAssetType(LLAssetType::AT_NONE),
- mFolderId(LLUUID::null),
+ mFolderId(destFolderId),
mItemId(LLUUID::null),
mAssetId(LLAssetID::null)
{
@@ -306,10 +308,10 @@ void LLResourceUploadInfo::assignDefaults()
}
else
{
- mFolderId = gInventory.findUserDefinedCategoryUUIDForType(
- (mDestinationFolderType == LLFolderType::FT_NONE) ?
- (LLFolderType::EType)mAssetType : mDestinationFolderType);
-}
+ mFolderId = gInventory.findUserDefinedCategoryUUIDForType(
+ (mDestinationFolderType == LLFolderType::FT_NONE) ?
+ (LLFolderType::EType)mAssetType : mDestinationFolderType);
+ }
}
std::string LLResourceUploadInfo::getDisplayName() const
@@ -366,10 +368,12 @@ LLNewFileResourceUploadInfo::LLNewFileResourceUploadInfo(
U32 groupPerms,
U32 everyonePerms,
S32 expectedCost,
+ const LLUUID& destFolderId,
bool show_inventory) :
LLResourceUploadInfo(name, description, compressionInfo,
destinationType, inventoryType,
- nextOWnerPerms, groupPerms, everyonePerms, expectedCost, show_inventory),
+ nextOWnerPerms, groupPerms, everyonePerms, expectedCost,
+ destFolderId, show_inventory),
mFileName(fileName),
mMaxImageSize(LLViewerFetchedTexture::MAX_IMAGE_SIZE_DEFAULT)
{
@@ -580,12 +584,13 @@ LLNewBufferedResourceUploadInfo::LLNewBufferedResourceUploadInfo(
U32 groupPerms,
U32 everyonePerms,
S32 expectedCost,
+ const LLUUID& destFolderId,
bool show_inventory,
uploadFinish_f finish,
uploadFailure_f failure)
: LLResourceUploadInfo(name, description, compressionInfo,
destinationType, inventoryType,
- nextOWnerPerms, groupPerms, everyonePerms, expectedCost, show_inventory)
+ nextOWnerPerms, groupPerms, everyonePerms, expectedCost, destFolderId, show_inventory)
, mBuffer(buffer)
, mFinishFn(finish)
, mFailureFn(failure)
diff --git a/indra/newview/llviewerassetupload.h b/indra/newview/llviewerassetupload.h
index 365436ede0..c627e9dbb8 100644
--- a/indra/newview/llviewerassetupload.h
+++ b/indra/newview/llviewerassetupload.h
@@ -54,6 +54,7 @@ public:
U32 groupPerms,
U32 everyonePerms,
S32 expectedCost,
+ const LLUUID &destFolderId = LLUUID::null,
bool showInventory = true);
virtual ~LLResourceUploadInfo()
@@ -104,6 +105,7 @@ protected:
U32 groupPerms,
U32 everyonePerms,
S32 expectedCost,
+ const LLUUID& destFolderId = LLUUID::null,
bool showInventory = true);
LLResourceUploadInfo(
@@ -155,6 +157,7 @@ public:
U32 groupPerms,
U32 everyonePerms,
S32 expectedCost,
+ const LLUUID &destFolderId = LLUUID::null,
bool show_inventory = true);
virtual LLSD prepareUpload();
@@ -193,6 +196,7 @@ public:
U32 groupPerms,
U32 everyonePerms,
S32 expectedCost,
+ const LLUUID& destFolderId, // use null for default
bool show_inventory,
uploadFinish_f finish,
uploadFailure_f failure);
@@ -219,6 +223,7 @@ public:
typedef std::function<void(LLUUID itemId, LLUUID taskId, LLUUID newAssetId, LLSD response)> taskUploadFinish_f;
typedef std::function<bool(LLUUID itemId, LLUUID taskId, LLSD response, std::string reason)> uploadFailed_f;
+ // destFolderId is the folder to put the new item in, leave null for default
LLBufferedAssetUploadInfo(LLUUID itemId, LLAssetType::EType assetType, std::string buffer, invnUploadFinish_f finish, uploadFailed_f failed);
LLBufferedAssetUploadInfo(LLUUID itemId, LLPointer<LLImageFormatted> image, invnUploadFinish_f finish);
LLBufferedAssetUploadInfo(LLUUID taskId, LLUUID itemId, LLAssetType::EType assetType, std::string buffer, taskUploadFinish_f finish, uploadFailed_f failed);
diff --git a/indra/newview/llviewerattachmenu.cpp b/indra/newview/llviewerattachmenu.cpp
index f2557e299c..9828ab1fdf 100644
--- a/indra/newview/llviewerattachmenu.cpp
+++ b/indra/newview/llviewerattachmenu.cpp
@@ -116,12 +116,12 @@ void LLViewerAttachMenu::attachObjects(const uuid_vec_t& items, const std::strin
LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getLinkedItem(id);
if(item && gInventory.isObjectDescendentOf(id, gInventory.getRootFolderID()))
{
- rez_attachment(item, attachmentp); // don't replace if called from an "Attach To..." menu
+ rez_attachment(item, attachmentp, false); // don't replace if called from an "Attach To..." menu
}
else if(item && item->isFinished())
{
// must be in library. copy it to our inventory and put it on.
- LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, attachmentp));
+ LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(rez_attachment_cb, _1, attachmentp, false));
copy_inventory_item(gAgent.getID(),
item->getPermissions().getOwner(),
item->getUUID(),
diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp
index 6cf99b68b2..a0d307a3f4 100644
--- a/indra/newview/llviewercamera.cpp
+++ b/indra/newview/llviewercamera.cpp
@@ -81,18 +81,16 @@ LLViewerCamera::~LLViewerCamera()
mCameraAngleChangedSignal.disconnect();
}
-void LLViewerCamera::updateCameraLocation(const LLVector3 &center, const LLVector3 &up_direction, const LLVector3 &point_of_interest)
+bool LLViewerCamera::updateCameraLocation(const LLVector3 &center, const LLVector3 &up_direction, const LLVector3 &point_of_interest)
{
// do not update if avatar didn't move
if (!LLViewerJoystick::getInstance()->getCameraNeedsUpdate())
{
- return;
+ return true;
}
- LLVector3 last_position;
- LLVector3 last_axis;
- last_position = getOrigin();
- last_axis = getAtAxis();
+ LLVector3 last_position = getOrigin();
+ LLVector3 last_axis = getAtAxis();
mLastPointOfInterest = point_of_interest;
@@ -102,30 +100,49 @@ void LLViewerCamera::updateCameraLocation(const LLVector3 &center, const LLVecto
regp = gAgent.getRegion();
}
- F32 water_height = (NULL != regp) ? regp->getWaterHeight() : 0.f;
+ F32 water_height = regp ? regp->getWaterHeight() : 0.f;
LLVector3 origin = center;
+ // Move origin[VZ] far enough (up or down) from the water surface
+ static const F32 MIN_DIST_TO_WATER = 0.2f;
+ F32& zpos = origin.mV[VZ];
+ if (zpos < water_height + MIN_DIST_TO_WATER)
{
- if (origin.mV[2] > water_height)
+ if (zpos >= water_height)
{
- origin.mV[2] = llmax(origin.mV[2], water_height + 0.20f);
+ zpos = water_height + MIN_DIST_TO_WATER;
}
- else
+ else if (zpos > water_height - MIN_DIST_TO_WATER)
{
- origin.mV[2] = llmin(origin.mV[2], water_height - 0.20f);
+ zpos = water_height - MIN_DIST_TO_WATER;
}
}
- setOriginAndLookAt(origin, up_direction, point_of_interest);
+ LLVector3 at(point_of_interest - origin);
+ at.normalize();
+ if (at.isNull() || !at.isFinite())
+ return false;
+
+ LLVector3 left(up_direction % at);
+ left.normalize();
+ if (left.isNull() || !left.isFinite())
+ return false;
+
+ LLVector3 up = at % left;
+ up.normalize();
+ if (up.isNull() || !up.isFinite())
+ return false;
+
+ setOrigin(origin);
+ setAxes(at, left, up);
mVelocityDir = origin - last_position ;
F32 dpos = mVelocityDir.normVec() ;
LLQuaternion rotation;
rotation.shortestArc(last_axis, getAtAxis());
- F32 x, y, z;
- F32 drot;
+ F32 drot, x, y, z;
rotation.getAngleAxis(&drot, &x, &y, &z);
add(sVelocityStat, dpos);
@@ -138,6 +155,8 @@ void LLViewerCamera::updateCameraLocation(const LLVector3 &center, const LLVecto
// update pixel meter ratio using default fov, not modified one
mPixelMeterRatio = (F32)(getViewHeightInPixels()/ (2.f*tanf(mCameraFOVDefault*0.5f)));
// update screen pixel area
+
+ return true;
mScreenPixelArea =(S32)((F32)getViewHeightInPixels() * ((F32)getViewHeightInPixels() * getAspect()));
}
@@ -145,7 +164,6 @@ const LLMatrix4 &LLViewerCamera::getProjection() const
{
calcProjection(getFar());
return mProjectionMatrix;
-
}
const LLMatrix4 &LLViewerCamera::getModelview() const
@@ -158,13 +176,12 @@ const LLMatrix4 &LLViewerCamera::getModelview() const
void LLViewerCamera::calcProjection(const F32 far_distance) const
{
- F32 fov_y, z_far, z_near, aspect, f;
- fov_y = getView();
- z_far = far_distance;
- z_near = getNear();
- aspect = getAspect();
+ F32 fov_y = getView();
+ F32 z_far = far_distance;
+ F32 z_near = getNear();
+ F32 aspect = getAspect();
- f = 1/tan(fov_y*0.5f);
+ F32 f = 1 / tan(fov_y * 0.5f);
mProjectionMatrix.setZero();
mProjectionMatrix.mMatrix[0][0] = f/aspect;
@@ -270,9 +287,9 @@ void LLViewerCamera::updateFrustumPlanes(LLCamera& camera, bool ortho, bool zfli
}
void LLViewerCamera::setPerspective(bool for_selection,
- S32 x, S32 y_from_bot, S32 width, S32 height,
- bool limit_select_distance,
- F32 z_near, F32 z_far)
+ S32 x, S32 y_from_bot, S32 width, S32 height,
+ bool limit_select_distance,
+ F32 z_near, F32 z_far)
{
F32 fov_y, aspect;
fov_y = getView();
@@ -334,7 +351,7 @@ void LLViewerCamera::setPerspective(bool for_selection,
{
float offset = mZoomFactor - 1.f;
int pos_y = mZoomSubregion / llceil(mZoomFactor);
- int pos_x = mZoomSubregion - (pos_y*llceil(mZoomFactor));
+ int pos_x = mZoomSubregion - (pos_y * llceil(mZoomFactor));
glm::mat4 translate;
translate = glm::translate(glm::vec3(offset - (F32)pos_x * 2.f, offset - (F32)pos_y * 2.f, 0.f));
@@ -347,7 +364,7 @@ void LLViewerCamera::setPerspective(bool for_selection,
calcProjection(z_far); // Update the projection matrix cache
- proj_mat *= glm::perspective(fov_y,aspect,z_near,z_far);
+ proj_mat *= glm::perspective(fov_y, aspect, z_near, z_far);
gGL.loadMatrix(glm::value_ptr(proj_mat));
@@ -355,7 +372,7 @@ void LLViewerCamera::setPerspective(bool for_selection,
gGL.matrixMode(LLRender::MM_MODELVIEW);
- glm::mat4 modelview(glm::make_mat4((GLfloat*) OGL_TO_CFR_ROTATION));
+ glm::mat4 modelview(glm::make_mat4((GLfloat*)OGL_TO_CFR_ROTATION));
GLfloat ogl_matrix[16];
@@ -371,9 +388,9 @@ void LLViewerCamera::setPerspective(bool for_selection,
// however, it is also unused (the GL matricies are used for selection, (see LLCamera::sphereInFrustum())) and so i'm not
// comfortable hacking on it.
calculateFrustumPlanesFromWindow((F32)(x - width / 2) / (F32)gViewerWindow->getWindowWidthScaled() - 0.5f,
- (F32)(y_from_bot - height / 2) / (F32)gViewerWindow->getWindowHeightScaled() - 0.5f,
- (F32)(x + width / 2) / (F32)gViewerWindow->getWindowWidthScaled() - 0.5f,
- (F32)(y_from_bot + height / 2) / (F32)gViewerWindow->getWindowHeightScaled() - 0.5f);
+ (F32)(y_from_bot - height / 2) / (F32)gViewerWindow->getWindowHeightScaled() - 0.5f,
+ (F32)(x + width / 2) / (F32)gViewerWindow->getWindowWidthScaled() - 0.5f,
+ (F32)(y_from_bot + height / 2) / (F32)gViewerWindow->getWindowHeightScaled() - 0.5f);
}
@@ -387,7 +404,6 @@ void LLViewerCamera::setPerspective(bool for_selection,
updateFrustumPlanes(*this);
}
-
// Uses the last GL matrices set in set_perspective to project a point from
// screen coordinates to the agent's region.
void LLViewerCamera::projectScreenToPosAgent(const S32 screen_x, const S32 screen_y, LLVector3* pos_agent) const
diff --git a/indra/newview/llviewercamera.h b/indra/newview/llviewercamera.h
index a204b85d88..61aebf73f6 100644
--- a/indra/newview/llviewercamera.h
+++ b/indra/newview/llviewercamera.h
@@ -61,7 +61,7 @@ public:
static eCameraID sCurCameraID;
- void updateCameraLocation(const LLVector3 &center,
+ bool updateCameraLocation(const LLVector3 &center,
const LLVector3 &up_direction,
const LLVector3 &point_of_interest);
@@ -77,12 +77,12 @@ public:
bool projectPosAgentToScreen(const LLVector3 &pos_agent, LLCoordGL &out_point, const bool clamp = true) const;
bool projectPosAgentToScreenEdge(const LLVector3 &pos_agent, LLCoordGL &out_point) const;
+ F32 getCosHalfFov() const { return mCosHalfCameraFOV; }
+ F32 getAverageSpeed() const { return mAverageSpeed; }
+ F32 getAverageAngularSpeed() const { return mAverageAngularSpeed; }
LLVector3 getVelocityDir() const {return mVelocityDir;}
static LLTrace::CountStatHandle<>* getVelocityStat() {return &sVelocityStat; }
static LLTrace::CountStatHandle<>* getAngularVelocityStat() {return &sAngularVelocityStat; }
- F32 getCosHalfFov() {return mCosHalfCameraFOV;}
- F32 getAverageSpeed() {return mAverageSpeed ;}
- F32 getAverageAngularSpeed() {return mAverageAngularSpeed;}
void getPixelVectors(const LLVector3 &pos_agent, LLVector3 &up, LLVector3 &right);
LLVector3 roundToPixel(const LLVector3 &pos_agent);
@@ -90,21 +90,21 @@ public:
// Sets the current matrix
/* virtual */ void setView(F32 vertical_fov_rads); // NOTE: broadcasts to simulator
void setViewNoBroadcast(F32 vertical_fov_rads); // set FOV without broadcasting to simulator (for temporary local cameras)
+ F32 getDefaultFOV() const { return mCameraFOVDefault; }
void setDefaultFOV(F32 fov) ;
- F32 getDefaultFOV() { return mCameraFOVDefault; }
bool isDefaultFOVChanged();
bool cameraUnderWater() const;
bool areVertsVisible(LLViewerObject* volumep, bool all_verts);
- const LLVector3 &getPointOfInterest() { return mLastPointOfInterest; }
+ const LLVector3& getPointOfInterest() const { return mLastPointOfInterest; }
F32 getPixelMeterRatio() const { return mPixelMeterRatio; }
S32 getScreenPixelArea() const { return mScreenPixelArea; }
void setZoomParameters(F32 factor, S16 subregion) { mZoomFactor = factor; mZoomSubregion = subregion; }
- F32 getZoomFactor() { return mZoomFactor; }
- S16 getZoomSubRegion() { return mZoomSubregion; }
+ F32 getZoomFactor() const { return mZoomFactor; }
+ S16 getZoomSubRegion() const { return mZoomSubregion; }
protected:
void calcProjection(const F32 far_distance) const;
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp
index e2022cae37..36ec6f0d78 100644
--- a/indra/newview/llviewerinventory.cpp
+++ b/indra/newview/llviewerinventory.cpp
@@ -966,7 +966,7 @@ void LLInventoryCallbackManager::fire(U32 callback_id, const LLUUID& item_id)
}
}
-void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachmentp)
+void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachmentp, bool replace)
{
if (inv_item.isNull())
return;
@@ -974,7 +974,7 @@ void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachme
LLViewerInventoryItem *item = gInventory.getItem(inv_item);
if (item)
{
- rez_attachment(item, attachmentp);
+ rez_attachment(item, attachmentp, replace);
}
}
@@ -1436,7 +1436,8 @@ void update_inventory_category(
if(obj)
{
if (LLFolderType::lookupIsProtectedType(obj->getPreferredType())
- && (updates.size() != 1 || !updates.has("thumbnail")))
+ && (updates.size() != 1
+ || !(updates.has("thumbnail") || updates.has("favorite"))))
{
LLNotificationsUtil::add("CannotModifyProtectedCategories");
return;
diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h
index 21a6606253..18daa368d9 100644
--- a/indra/newview/llviewerinventory.h
+++ b/indra/newview/llviewerinventory.h
@@ -264,7 +264,7 @@ public:
class LLViewerJointAttachment;
-void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachmentp);
+void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachmentp, bool replace);
void activate_gesture_cb(const LLUUID& inv_item);
diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp
index 7543fb3743..9d45ea24b9 100644
--- a/indra/newview/llviewerjoystick.cpp
+++ b/indra/newview/llviewerjoystick.cpp
@@ -881,6 +881,10 @@ void LLViewerJoystick::moveObjects(bool reset)
{
gAgent.clearAFK();
}
+ else
+ {
+ gAwayTriggerTimer.reset();
+ }
if (sDelta[0] || sDelta[1] || sDelta[2])
{
@@ -1055,6 +1059,10 @@ void LLViewerJoystick::moveAvatar(bool reset)
{
gAgent.clearAFK();
}
+ else
+ {
+ gAwayTriggerTimer.reset();
+ }
setCameraNeedsUpdate(true);
}
@@ -1267,10 +1275,17 @@ void LLViewerJoystick::moveFlycam(bool reset)
}
// Clear AFK state if moved beyond the deadzone
- if (!is_zero && gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME)
+ if (!is_zero)
+ {
+ if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME)
{
gAgent.clearAFK();
}
+ else
+ {
+ gAwayTriggerTimer.reset();
+ }
+ }
sFlycamPosition += LLVector3(sDelta) * sFlycamRotation;
@@ -1331,6 +1346,10 @@ bool LLViewerJoystick::toggleFlycam()
{
gAgent.clearAFK();
}
+ else
+ {
+ gAwayTriggerTimer.reset();
+ }
mOverrideCamera = !mOverrideCamera;
if (mOverrideCamera)
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 1f8f960300..7c073a4f39 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -90,6 +90,7 @@
#include "lltoolface.h"
#include "llhints.h"
#include "llhudeffecttrail.h"
+#include "llhudeffectresetskeleton.h"
#include "llhudmanager.h"
#include "llimview.h"
#include "llinventorybridge.h"
@@ -1851,7 +1852,6 @@ class LLAdvancedAppearanceToXML : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- std::string emptyname;
LLViewerObject *obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
LLVOAvatar *avatar = NULL;
if (obj)
@@ -1878,7 +1878,7 @@ class LLAdvancedAppearanceToXML : public view_listener_t
}
if (avatar)
{
- avatar->dumpArchetypeXML(emptyname);
+ avatar->dumpArchetypeXML(LLStringUtil::null);
}
return true;
}
@@ -5646,6 +5646,38 @@ class LLToolsEnablePathfindingRebakeRegion : public view_listener_t
}
};
+class LLToolsCheckSelectionLODMode : public view_listener_t
+{
+ bool handleEvent(const LLSD& userdata)
+ {
+ std::string param = userdata.asString();
+ static LLCachedControl<S32> debug_selection_lods(gSavedSettings, "DebugSelectionLODs", 0);
+ if ("default" == param)
+ {
+ return debug_selection_lods() < 0;
+ }
+ else if ("high" == param)
+ {
+ return debug_selection_lods() == 3;
+ }
+ else if ("medium" == param)
+ {
+ return debug_selection_lods() == 2;
+ }
+ else if ("low" == param)
+ {
+ return debug_selection_lods() == 1;
+ }
+ else if ("lowest" == param)
+ {
+ return debug_selection_lods() == 0;
+ }
+
+ return false;
+ }
+};
+
+
// Round the position of all root objects to the grid
class LLToolsSnapObjectXY : public view_listener_t
{
@@ -6670,8 +6702,18 @@ class LLAvatarResetSkeleton : public view_listener_t
{
if (LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()))
{
+ if(avatar->getID() == gAgentID)
+ {
+ LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, true);
+ effectp->setSourceObject(gAgentAvatarp);
+ effectp->setTargetObject((LLViewerObject*)avatar);
+ effectp->setResetAnimations(false);
+ }
+ else
+ {
avatar->resetSkeleton(false);
}
+ }
return true;
}
};
@@ -6694,8 +6736,18 @@ class LLAvatarResetSkeletonAndAnimations : public view_listener_t
{
if (LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()))
{
+ if(avatar->getID() == gAgentID)
+ {
+ LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, true);
+ effectp->setSourceObject(gAgentAvatarp);
+ effectp->setTargetObject((LLViewerObject*)avatar);
+ effectp->setResetAnimations(true);
+ }
+ else
+ {
avatar->resetSkeleton(true);
}
+ }
return true;
}
};
@@ -6722,11 +6774,24 @@ class LLAvatarResetSelfSkeletonAndAnimations : public view_listener_t
{
if (LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()))
{
- avatar->resetSkeleton(true);
+ if(avatar->getID() == gAgentID)
+ {
+ LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, true);
+ effectp->setSourceObject(gAgentAvatarp);
+ effectp->setTargetObject((LLViewerObject*)avatar);
+ effectp->setResetAnimations(true);
+ }
+ else
+ {
+ avatar->resetSkeleton(true);
+ }
}
else
{
- gAgentAvatarp->resetSkeleton(true);
+ LLHUDEffectResetSkeleton* effectp = (LLHUDEffectResetSkeleton*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_RESET_SKELETON, true);
+ effectp->setSourceObject(gAgentAvatarp);
+ effectp->setTargetObject(gAgentAvatarp);
+ effectp->setResetAnimations(true);
}
return true;
}
@@ -8572,6 +8637,36 @@ class LLToolsSelectBySurrounding : public view_listener_t
}
};
+class LLToolsSelectionLODMode : public view_listener_t
+{
+ bool handleEvent(const LLSD& userdata)
+ {
+ std::string param = userdata.asString();
+ if ("default" == param)
+ {
+ gSavedSettings.setS32("DebugSelectionLODs", -1);
+ }
+ else if ("high" == param)
+ {
+ gSavedSettings.setS32("DebugSelectionLODs", 3);
+ }
+ else if ("medium" == param)
+ {
+ gSavedSettings.setS32("DebugSelectionLODs", 2);
+ }
+ else if ("low" == param)
+ {
+ gSavedSettings.setS32("DebugSelectionLODs", 1);
+ }
+ else if ("lowest" == param)
+ {
+ gSavedSettings.setS32("DebugSelectionLODs", 0);
+ }
+
+ return true;
+ }
+};
+
class LLToolsShowHiddenSelection : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
@@ -9806,6 +9901,7 @@ void initialize_menus()
view_listener_t::addMenu(new LLToolsSelectInvisibleObjects(), "Tools.SelectInvisibleObjects");
view_listener_t::addMenu(new LLToolsSelectReflectionProbes(), "Tools.SelectReflectionProbes");
view_listener_t::addMenu(new LLToolsSelectBySurrounding(), "Tools.SelectBySurrounding");
+ view_listener_t::addMenu(new LLToolsSelectionLODMode(), "Tools.SelectionLODMode");
view_listener_t::addMenu(new LLToolsShowHiddenSelection(), "Tools.ShowHiddenSelection");
view_listener_t::addMenu(new LLToolsShowSelectionLightRadius(), "Tools.ShowSelectionLightRadius");
view_listener_t::addMenu(new LLToolsEditLinkedParts(), "Tools.EditLinkedParts");
@@ -9838,6 +9934,7 @@ void initialize_menus()
view_listener_t::addMenu(new LLToolsEnablePathfindingView(), "Tools.EnablePathfindingView");
view_listener_t::addMenu(new LLToolsDoPathfindingRebakeRegion(), "Tools.DoPathfindingRebakeRegion");
view_listener_t::addMenu(new LLToolsEnablePathfindingRebakeRegion(), "Tools.EnablePathfindingRebakeRegion");
+ view_listener_t::addMenu(new LLToolsCheckSelectionLODMode(), "Tools.ToolsCheckSelectionLODMode");
// Help menu
// most items use the ShowFloater method
diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp
index ce66dbc03f..fecc0edba4 100644
--- a/indra/newview/llviewermenufile.cpp
+++ b/indra/newview/llviewermenufile.cpp
@@ -478,13 +478,19 @@ const bool check_file_extension(const std::string& filename, LLFilePicker::ELoad
return true;
}
-const void upload_single_file(const std::vector<std::string>& filenames, LLFilePicker::ELoadFilter type)
+void upload_single_file(
+ const std::vector<std::string>& filenames,
+ LLFilePicker::ELoadFilter type,
+ const LLUUID& dest)
{
std::string filename = filenames[0];
if (!check_file_extension(filename, type)) return;
if (!filename.empty())
{
+ LLSD args;
+ args["filename"] = filename;
+ args["dest"] = dest;
if (type == LLFilePicker::FFLOAD_WAV)
{
// pre-qualify wavs to make sure the format is acceptable
@@ -499,12 +505,12 @@ const void upload_single_file(const std::vector<std::string>& filenames, LLFileP
}
else
{
- LLFloaterReg::showInstance("upload_sound", LLSD(filename));
+ LLFloaterReg::showInstance("upload_sound", args);
}
}
if (type == LLFilePicker::FFLOAD_IMAGE)
{
- LLFloaterReg::showInstance("upload_image", LLSD(filename));
+ LLFloaterReg::showInstance("upload_image", args);
}
if (type == LLFilePicker::FFLOAD_ANIM)
{
@@ -512,11 +518,11 @@ const void upload_single_file(const std::vector<std::string>& filenames, LLFileP
LLStringUtil::toLower(filename_lc);
if (filename_lc.rfind(".anim") != std::string::npos)
{
- LLFloaterReg::showInstance("upload_anim_anim", LLSD(filename));
+ LLFloaterReg::showInstance("upload_anim_anim", args);
}
else
{
- LLFloaterReg::showInstance("upload_anim_bvh", LLSD(filename));
+ LLFloaterReg::showInstance("upload_anim_bvh", args);
}
}
}
@@ -709,7 +715,7 @@ bool get_bulk_upload_expected_cost(
return file_count > 0;
}
-const void upload_bulk(const std::vector<std::string>& filtered_filenames, bool allow_2k)
+void upload_bulk(const std::vector<std::string>& filtered_filenames, bool allow_2k, const LLUUID& dest)
{
S32 expected_upload_cost;
S32 expected_upload_count;
@@ -721,6 +727,7 @@ const void upload_bulk(const std::vector<std::string>& filtered_filenames, bool
key["upload_cost"] = expected_upload_cost;
key["upload_count"] = expected_upload_count;
key["has_2k_textures"] = (textures_2k_count > 0);
+ key["dest"] = dest;
LLSD array;
for (const std::string& str : filtered_filenames)
@@ -754,7 +761,7 @@ const void upload_bulk(const std::vector<std::string>& filtered_filenames, bool
}
-const void upload_bulk(const std::vector<std::string>& filenames, LLFilePicker::ELoadFilter type, bool allow_2k)
+void upload_bulk(const std::vector<std::string>& filenames, LLFilePicker::ELoadFilter type, bool allow_2k, const LLUUID& dest)
{
// TODO:
// Check user balance for entire cost
@@ -776,7 +783,7 @@ const void upload_bulk(const std::vector<std::string>& filenames, LLFilePicker::
filtered_filenames.push_back(filename);
}
}
- upload_bulk(filtered_filenames, allow_2k);
+ upload_bulk(filtered_filenames, allow_2k, dest);
}
class LLFileUploadImage : public view_listener_t
@@ -787,7 +794,7 @@ class LLFileUploadImage : public view_listener_t
{
gAgentCamera.changeCameraToDefault();
}
- LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2), LLFilePicker::FFLOAD_IMAGE, false);
+ LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2, LLUUID::null), LLFilePicker::FFLOAD_IMAGE, false);
return true;
}
};
@@ -818,7 +825,7 @@ class LLFileUploadSound : public view_listener_t
{
gAgentCamera.changeCameraToDefault();
}
- LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2), LLFilePicker::FFLOAD_WAV, false);
+ LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2, LLUUID::null), LLFilePicker::FFLOAD_WAV, false);
return true;
}
};
@@ -831,7 +838,7 @@ class LLFileUploadAnim : public view_listener_t
{
gAgentCamera.changeCameraToDefault();
}
- LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2), LLFilePicker::FFLOAD_ANIM, false);
+ LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2, LLUUID::null), LLFilePicker::FFLOAD_ANIM, false);
return true;
}
};
@@ -844,7 +851,7 @@ class LLFileUploadBulk : public view_listener_t
{
gAgentCamera.changeCameraToDefault();
}
- LLFilePickerReplyThread::startPicker(boost::bind(&upload_bulk, _1, _2, true), LLFilePicker::FFLOAD_ALL, true);
+ LLFilePickerReplyThread::startPicker(boost::bind(&upload_bulk, _1, _2, true, LLUUID::null), LLFilePicker::FFLOAD_ALL, true);
return true;
}
};
@@ -1132,7 +1139,7 @@ LLUUID upload_new_resource(
name, desc, compression_info,
destination_folder_type, inv_type,
next_owner_perms, group_perms, everyone_perms,
- expected_upload_cost, show_inventory));
+ expected_upload_cost, LLUUID::null, show_inventory));
upload_new_resource(uploadInfo, callback, userdata);
return LLUUID::null;
diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h
index d99f9dc4c6..8f7df48a2e 100644
--- a/indra/newview/llviewermenufile.h
+++ b/indra/newview/llviewermenufile.h
@@ -74,6 +74,17 @@ bool get_bulk_upload_expected_cost(
void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k);
+void upload_single_file(
+ const std::vector<std::string>& filenames,
+ LLFilePicker::ELoadFilter type,
+ const LLUUID& dest);
+
+void upload_bulk(
+ const std::vector<std::string>& filenames,
+ LLFilePicker::ELoadFilter type,
+ bool allow_2k,
+ const LLUUID& dest);
+
//consider moving all file pickers below to more suitable place
class LLFilePickerThread : public LLThread
{ //multi-threaded file picker (runs system specific file picker in background and calls "notify" from main thread)
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 5fd820f91d..3b16708091 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -2137,6 +2137,21 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
EInstantMessage dialog = (EInstantMessage)d;
LLHost sender = msg->getSender();
+ LLSD metadata;
+ if (msg->getNumberOfBlocksFast(_PREHASH_MetaData) > 0)
+ {
+ S32 metadata_size = msg->getSizeFast(_PREHASH_MetaData, 0, _PREHASH_Data);
+ std::string metadata_buffer;
+ metadata_buffer.resize(metadata_size, 0);
+
+ msg->getBinaryDataFast(_PREHASH_MetaData, _PREHASH_Data, &metadata_buffer[0], metadata_size, 0, metadata_size );
+ std::stringstream metadata_stream(metadata_buffer);
+ if (LLSDSerialize::fromBinary(metadata, metadata_stream, metadata_size) == LLSDParser::PARSE_FAILURE)
+ {
+ metadata.clear();
+ }
+ }
+
LLIMProcessing::processNewMessage(from_id,
from_group,
to_id,
@@ -2151,7 +2166,8 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
position,
binary_bucket,
binary_bucket_size,
- sender);
+ sender,
+ metadata);
}
void send_do_not_disturb_message (LLMessageSystem* msg, const LLUUID& from_id, const LLUUID& session_id)
@@ -6641,7 +6657,6 @@ void process_initiate_download(LLMessageSystem* msg, void**)
(void**)new std::string(viewer_filename));
}
-
void process_script_teleport_request(LLMessageSystem* msg, void**)
{
if (!gSavedSettings.getBOOL("ScriptsCanShowUI")) return;
@@ -6655,6 +6670,11 @@ void process_script_teleport_request(LLMessageSystem* msg, void**)
msg->getString("Data", "SimName", sim_name);
msg->getVector3("Data", "SimPosition", pos);
msg->getVector3("Data", "LookAt", look_at);
+ U32 flags = (BEACON_SHOW_MAP | BEACON_FOCUS_MAP);
+ if (msg->has("Options"))
+ {
+ msg->getU32("Options", "Flags", flags);
+ }
LLFloaterWorldMap* instance = LLFloaterWorldMap::getInstance();
if(instance)
@@ -6665,7 +6685,13 @@ void process_script_teleport_request(LLMessageSystem* msg, void**)
<< LL_ENDL;
instance->trackURL(sim_name, (S32)pos.mV[VX], (S32)pos.mV[VY], (S32)pos.mV[VZ]);
- LLFloaterReg::showInstance("world_map", "center");
+ if (flags & BEACON_SHOW_MAP)
+ {
+ bool old_auto_focus = instance->getAutoFocus();
+ instance->setAutoFocus(flags & BEACON_FOCUS_MAP);
+ instance->openFloater("center");
+ instance->setAutoFocus(old_auto_focus);
+ }
}
// remove above two lines and replace with below line
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index c5e81dd179..8d90187e91 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -2325,6 +2325,12 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
// Set the rotation of the object followed by adjusting for the accumulated angular velocity (llSetTargetOmega)
setRotation(new_rot * mAngularVelocityRot);
+ if ((mFlags & FLAGS_SERVER_AUTOPILOT) && asAvatar() && asAvatar()->isSelf())
+ {
+ gAgent.resetAxes();
+ gAgent.rotate(new_rot);
+ gAgentCamera.resetView();
+ }
setChanged(ROTATED | SILHOUETTE);
}
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index 8e6657b4b9..1a5c40064a 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -1327,12 +1327,12 @@ const S32 LLViewerParcelMgr::getAgentParcelId() const
return INVALID_PARCEL_ID;
}
-void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel, bool use_agent_region)
+void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel)
{
if(!parcel)
return;
- LLViewerRegion *region = use_agent_region ? gAgent.getRegion() : LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth );
+ LLViewerRegion *region = LLWorld::getInstance()->getRegionFromID(parcel->getRegionID());
if (!region)
return;
@@ -1676,10 +1676,16 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
// Actually extract the data.
if (parcel)
{
+ // store region_id in the parcel so we can find it again later
+ LLViewerRegion* parcel_region = LLWorld::getInstance()->getRegion(msg->getSender());
+ if (parcel_region)
+ {
+ parcel->setRegionID(parcel_region->getRegionID());
+ }
+
if (local_id == parcel_mgr.mAgentParcel->getLocalID())
{
// Parcels in different regions can have same ids.
- LLViewerRegion* parcel_region = LLWorld::getInstance()->getRegion(msg->getSender());
LLViewerRegion* agent_region = gAgent.getRegion();
if (parcel_region && agent_region && parcel_region->getRegionID() == agent_region->getRegionID())
{
diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h
index 974ea39359..086bca4878 100644
--- a/indra/newview/llviewerparcelmgr.h
+++ b/indra/newview/llviewerparcelmgr.h
@@ -219,7 +219,7 @@ public:
// containing the southwest corner of the selection.
// If want_reply_to_update, simulator will send back a ParcelProperties
// message.
- void sendParcelPropertiesUpdate(LLParcel* parcel, bool use_agent_region = false);
+ void sendParcelPropertiesUpdate(LLParcel* parcel);
// Takes an Access List flag, like AL_ACCESS or AL_BAN
void sendParcelAccessListUpdate(U32 which);
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 4a9dd1c1b6..5ba0a86e68 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -1107,6 +1107,7 @@ void LLViewerFetchedTexture::init(bool firstinit)
mOrigHeight = 0;
mHasAux = false;
mNeedsAux = false;
+ mLastWorkerDiscardLevel = -1;
mRequestedDiscardLevel = -1;
mRequestedDownloadPriority = 0.f;
mFullyLoaded = false;
@@ -1259,12 +1260,11 @@ void LLViewerFetchedTexture::loadFromFastCache()
if (mBoostLevel == LLGLTexture::BOOST_THUMBNAIL)
{
- S32 expected_width = mKnownDrawWidth > 0 ? mKnownDrawWidth : DEFAULT_THUMBNAIL_DIMENSIONS;
- S32 expected_height = mKnownDrawHeight > 0 ? mKnownDrawHeight : DEFAULT_THUMBNAIL_DIMENSIONS;
- if (mRawImage && (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height))
+ if (mRawImage && (mRawImage->getWidth() > DEFAULT_THUMBNAIL_DIMENSIONS || mRawImage->getHeight() > DEFAULT_THUMBNAIL_DIMENSIONS))
{
- // scale oversized icon, no need to give more work to gl
- mRawImage->scale(expected_width, expected_height);
+ // Scale oversized thumbnail
+ // thumbnails aren't supposed to go over DEFAULT_THUMBNAIL_DIMENSIONS
+ mRawImage->scale(DEFAULT_THUMBNAIL_DIMENSIONS, DEFAULT_THUMBNAIL_DIMENSIONS);
}
}
@@ -1957,9 +1957,9 @@ bool LLViewerFetchedTexture::processFetchResults(S32& desired_discard, S32 curre
bool LLViewerFetchedTexture::updateFetch()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
- static LLCachedControl<bool> textures_decode_disabled(gSavedSettings,"TextureDecodeDisabled", false);
+ static LLCachedControl<bool> textures_decode_disabled(gSavedSettings, "TextureDecodeDisabled", false);
- if(textures_decode_disabled) // don't fetch the surface textures in wireframe mode
+ if (textures_decode_disabled) // don't fetch the surface textures in wireframe mode
{
return false;
}
@@ -1994,7 +1994,7 @@ bool LLViewerFetchedTexture::updateFetch()
LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE("vftuf - callback pending");
return false; // process any raw image data in callbacks before replacing
}
- if(mInFastCacheList)
+ if (mInFastCacheList)
{
LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE("vftuf - in fast cache");
return false;
@@ -2019,7 +2019,7 @@ bool LLViewerFetchedTexture::updateFetch()
if (mAuxRawImage.notNull()) sAuxCount--;
// keep in mind that fetcher still might need raw image, don't modify original
bool finished = LLAppViewer::getTextureFetch()->getRequestFinished(getID(), fetch_discard, mFetchState, mRawImage, mAuxRawImage,
- mLastHttpGetStatus);
+ mLastHttpGetStatus);
if (mRawImage.notNull()) sRawCount++;
if (mAuxRawImage.notNull())
{
@@ -2035,7 +2035,7 @@ bool LLViewerFetchedTexture::updateFetch()
else
{
mFetchState = LLAppViewer::getTextureFetch()->getFetchState(mID, mDownloadProgress, mRequestedDownloadPriority,
- mFetchPriority, mFetchDeltaTime, mRequestDeltaTime, mCanUseHTTP);
+ mFetchPriority, mFetchDeltaTime, mRequestDeltaTime, mCanUseHTTP);
}
if (!processFetchResults(desired_discard, current_discard, fetch_discard, decode_priority))
@@ -2046,7 +2046,7 @@ bool LLViewerFetchedTexture::updateFetch()
if (mIsFetching)
{
static const F32 MAX_HOLD_TIME = 5.0f; //seconds to wait before canceling fecthing if decode_priority is 0.f.
- if(decode_priority > 0.0f || mStopFetchingTimer.getElapsedTimeF32() > MAX_HOLD_TIME)
+ if (decode_priority > 0.0f || mStopFetchingTimer.getElapsedTimeF32() > MAX_HOLD_TIME)
{
mStopFetchingTimer.reset();
LLAppViewer::getTextureFetch()->updateRequestPriority(mID, decode_priority);
@@ -2062,7 +2062,7 @@ bool LLViewerFetchedTexture::updateFetch()
LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE("vftuf - priority <= 0");
make_request = false;
}
- else if(mDesiredDiscardLevel > getMaxDiscardLevel())
+ else if (mDesiredDiscardLevel > getMaxDiscardLevel())
{
LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE("vftuf - desired > max");
make_request = false;
@@ -2103,7 +2103,7 @@ bool LLViewerFetchedTexture::updateFetch()
if (make_request)
{
LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE("vftuf - make request");
- S32 w=0, h=0, c=0;
+ S32 w = 0, h = 0, c = 0;
if (getDiscardLevel() >= 0)
{
w = mGLTexturep->getWidth(0);
@@ -2121,18 +2121,19 @@ bool LLViewerFetchedTexture::updateFetch()
S32 fetch_request_response = -1;
S32 worker_discard = -1;
fetch_request_response = LLAppViewer::getTextureFetch()->createRequest(mFTType, mUrl, getID(), getTargetHost(), decode_priority,
- w, h, c, desired_discard, needsAux(), mCanUseHTTP);
+ w, h, c, desired_discard, needsAux(), mCanUseHTTP);
if (fetch_request_response >= 0) // positive values and 0 are discard values
{
LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE("vftuf - request created");
mHasFetcher = true;
mIsFetching = true;
+ mLastWorkerDiscardLevel = worker_discard;
// in some cases createRequest can modify discard, as an example
// bake textures are always at discard 0
mRequestedDiscardLevel = llmin(desired_discard, fetch_request_response);
mFetchState = LLAppViewer::getTextureFetch()->getFetchState(mID, mDownloadProgress, mRequestedDownloadPriority,
- mFetchPriority, mFetchDeltaTime, mRequestDeltaTime, mCanUseHTTP);
+ mFetchPriority, mFetchDeltaTime, mRequestDeltaTime, mCanUseHTTP);
}
else if (fetch_request_response == LLTextureFetch::CREATE_REQUEST_ERROR_TRANSITION)
{
@@ -2146,7 +2147,7 @@ bool LLViewerFetchedTexture::updateFetch()
S32 decoded_discard;
bool decoded;
S32 fetch_state = LLAppViewer::getTextureFetch()->getLastFetchState(mID, desired_discard, decoded_discard, decoded);
- if (fetch_state > 1 && decoded && decoded_discard >=0 && decoded_discard <= desired_discard)
+ if (fetch_state > 1 && decoded && decoded_discard >= 0 && decoded_discard <= desired_discard)
{
// worker actually has the image
if (mRawImage.notNull()) sRawCount--;
@@ -2770,11 +2771,9 @@ void LLViewerFetchedTexture::saveRawImage()
}
else if (mBoostLevel == LLGLTexture::BOOST_THUMBNAIL)
{
- S32 expected_width = mKnownDrawWidth > 0 ? mKnownDrawWidth : DEFAULT_THUMBNAIL_DIMENSIONS;
- S32 expected_height = mKnownDrawHeight > 0 ? mKnownDrawHeight : DEFAULT_THUMBNAIL_DIMENSIONS;
- if (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height)
+ if (mRawImage->getWidth() > DEFAULT_THUMBNAIL_DIMENSIONS || mRawImage->getHeight() > DEFAULT_THUMBNAIL_DIMENSIONS)
{
- mSavedRawImage = new LLImageRaw(expected_width, expected_height, mRawImage->getComponents());
+ mSavedRawImage = new LLImageRaw(DEFAULT_THUMBNAIL_DIMENSIONS, DEFAULT_THUMBNAIL_DIMENSIONS, mRawImage->getComponents());
mSavedRawImage->copyScaled(mRawImage);
}
else
diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h
index e1582c74bd..f9311d85cb 100644
--- a/indra/newview/llviewertexture.h
+++ b/indra/newview/llviewertexture.h
@@ -444,6 +444,7 @@ protected:
bool mKnownDrawSizeChanged ;
std::string mUrl;
+ S32 mLastWorkerDiscardLevel;
S32 mRequestedDiscardLevel;
F32 mRequestedDownloadPriority;
S32 mFetchState;
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index ef6409c23b..50c38899c3 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1424,11 +1424,17 @@ void LLViewerWindow::handleMouseMove(LLWindow *window, LLCoordGL pos, MASK mask
mWindow->showCursorFromMouseMove();
- if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME
- && !gDisconnected)
+ if (!gDisconnected)
+ {
+ if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME)
{
gAgent.clearAFK();
}
+ else
+ {
+ gAwayTriggerTimer.reset();
+ }
+ }
}
void LLViewerWindow::handleMouseDragged(LLWindow *window, LLCoordGL pos, MASK mask)
@@ -1547,6 +1553,10 @@ bool LLViewerWindow::handleTranslatedKeyDown(KEY key, MASK mask, bool repeated)
{
gAgent.clearAFK();
}
+ else
+ {
+ gAwayTriggerTimer.reset();
+ }
// *NOTE: We want to interpret KEY_RETURN later when it arrives as
// a Unicode char, not as a keydown. Otherwise when client frame
@@ -3017,7 +3027,8 @@ bool LLViewerWindow::handleKey(KEY key, MASK mask)
{
if ((focusedFloaterName == "nearby_chat") || (focusedFloaterName == "im_container") || (focusedFloaterName == "impanel"))
{
- if (gSavedSettings.getBOOL("ArrowKeysAlwaysMove"))
+ LLCachedControl<bool> key_move(gSavedSettings, "ArrowKeysAlwaysMove");
+ if (key_move())
{
// let Control-Up and Control-Down through for chat line history,
if (!(key == KEY_UP && mask == MASK_CONTROL)
@@ -3031,10 +3042,9 @@ bool LLViewerWindow::handleKey(KEY key, MASK mask)
case KEY_RIGHT:
case KEY_UP:
case KEY_DOWN:
- case KEY_PAGE_UP:
- case KEY_PAGE_DOWN:
- case KEY_HOME:
- case KEY_END:
+ case KEY_PAGE_UP: //jump
+ case KEY_PAGE_DOWN: // down
+ case KEY_HOME: // toggle fly
// when chatbar is empty or ArrowKeysAlwaysMove set,
// pass arrow keys on to avatar...
return false;
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 1cca2161fe..3121a9ed8c 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -576,7 +576,7 @@ private:
// joint states to be animated
//-------------------------------------------------------------------------
LLPointer<LLJointState> mPelvisState;
- LLCharacter* mCharacter;
+ LLCharacter* mCharacter;
};
/**
@@ -684,6 +684,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
mPreviousFullyLoaded(false),
mFullyLoadedInitialized(false),
mLastCloudAttachmentCount(-1),
+ mFullyLoadedFrameCounter(0),
mVisualComplexity(VISUAL_COMPLEXITY_UNKNOWN),
mLoadedCallbacksPaused(false),
mLoadedCallbackTextures(0),
@@ -777,11 +778,9 @@ std::string LLVOAvatar::avString() const
{
return " " + getFullname() + " ";
}
- else
- {
- std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus());
- return " Avatar '" + getFullname() + "' " + viz_string + " ";
- }
+
+ std::string status = LLVOAvatar::rezStatusToString(getRezzedStatus());
+ return " Avatar '" + getDebugName() + "' " + status + " ";
}
void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string comment)
@@ -804,10 +803,10 @@ void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string c
if (gSavedSettings.getBOOL("DebugAvatarRezTime"))
{
LLSD args;
- args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32());
- args["TIME"] = llformat("%d",(U32)mRuthDebugTimer.getElapsedTimeF32());
+ args["EXISTENCE"] = llformat("%d", (U32)mDebugExistenceTimer.getElapsedTimeF32());
+ args["TIME"] = llformat("%d", (U32)mRuthDebugTimer.getElapsedTimeF32());
args["NAME"] = getFullname();
- LLNotificationsUtil::add(notification_name,args);
+ LLNotificationsUtil::add(notification_name, args);
}
}
@@ -835,14 +834,14 @@ LLVOAvatar::~LLVOAvatar()
}
if (!mFullyLoaded)
{
- debugAvatarRezTime("AvatarRezLeftCloudNotification","left after ruth seconds as cloud");
+ debugAvatarRezTime("AvatarRezLeftCloudNotification", "left after ruth seconds as cloud");
}
else
{
- debugAvatarRezTime("AvatarRezLeftNotification","left sometime after declouding");
+ debugAvatarRezTime("AvatarRezLeftNotification", "left sometime after declouding");
}
- if(mTuned)
+ if (mTuned)
{
LLPerfStats::tunedAvatars--;
mTuned = false;
@@ -984,7 +983,7 @@ bool LLVOAvatar::areAllNearbyInstancesBaked(S32& grey_avatars)
++grey_avatars;
}
}
- return !grey_avatars;
+ return grey_avatars == 0;
}
// static
@@ -3010,7 +3009,7 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update)
LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
if (LLVOAvatar::sJointDebug)
{
- LL_INFOS() << getFullname() << ": joint touches: " << LLJoint::sNumTouches << " updates: " << LLJoint::sNumUpdates << LL_ENDL;
+ LL_INFOS() << getDebugName() << ": joint touches: " << LLJoint::sNumTouches << " updates: " << LLJoint::sNumUpdates << LL_ENDL;
}
LLJoint::sNumUpdates = 0;
@@ -3230,17 +3229,17 @@ F32 LLVOAvatar::calcMorphAmount() const
void LLVOAvatar::idleUpdateLipSync(bool voice_enabled)
{
// Use the Lipsync_Ooh and Lipsync_Aah morphs for lip sync
- if ( voice_enabled
+ if (voice_enabled
&& mLastRezzedStatus > 0 // no point updating lip-sync for clouds
&& LLVoiceVisualizer::getLipSyncEnabled()
- && LLVoiceClient::getInstance()->getIsSpeaking( mID ) )
+ && LLVoiceClient::getInstance()->getIsSpeaking(mID))
{
F32 ooh_morph_amount = 0.0f;
F32 aah_morph_amount = 0.0f;
mVoiceVisualizer->lipSyncOohAah( ooh_morph_amount, aah_morph_amount );
- if( mOohMorph )
+ if (mOohMorph)
{
F32 ooh_weight = mOohMorph->getMinWeight()
+ ooh_morph_amount * (mOohMorph->getMaxWeight() - mOohMorph->getMinWeight());
@@ -3248,7 +3247,7 @@ void LLVOAvatar::idleUpdateLipSync(bool voice_enabled)
mOohMorph->setWeight( ooh_weight);
}
- if( mAahMorph )
+ if (mAahMorph)
{
F32 aah_weight = mAahMorph->getMinWeight()
+ aah_morph_amount * (mAahMorph->getMaxWeight() - mAahMorph->getMinWeight());
@@ -4335,8 +4334,8 @@ void LLVOAvatar::computeUpdatePeriod()
{
const LLVector4a* ext = mDrawable->getSpatialExtents();
LLVector4a size;
- size.setSub(ext[1],ext[0]);
- F32 mag = size.getLength3().getF32()*0.5f;
+ size.setSub(ext[1], ext[0]);
+ F32 mag = size.getLength3().getF32() * 0.5f;
const S32 UPDATE_RATE_SLOW = 64;
const S32 UPDATE_RATE_MED = 48;
@@ -4346,14 +4345,14 @@ void LLVOAvatar::computeUpdatePeriod()
{ // visually muted avatars update at lowest rate
mUpdatePeriod = UPDATE_RATE_SLOW;
}
- else if (! shouldImpostor()
- || mDrawable->mDistanceWRTCamera < 1.f + mag)
+ else if (!shouldImpostor()
+ || mDrawable->mDistanceWRTCamera < 1.f + mag)
{ // first 25% of max visible avatars are not impostored
// also, don't impostor avatars whose bounding box may be penetrating the
// impostor camera near clip plane
mUpdatePeriod = 1;
}
- else if ( shouldImpostor(4.0) )
+ else if (shouldImpostor(4.0))
{ //background avatars are REALLY slow updating impostors
mUpdatePeriod = UPDATE_RATE_SLOW;
}
@@ -4362,7 +4361,7 @@ void LLVOAvatar::computeUpdatePeriod()
// Don't update cloud avatars too often
mUpdatePeriod = UPDATE_RATE_SLOW;
}
- else if ( shouldImpostor(3.0) )
+ else if (shouldImpostor(3.0))
{ //back 25% of max visible avatars are slow updating impostors
mUpdatePeriod = UPDATE_RATE_MED;
}
@@ -6211,8 +6210,11 @@ void LLVOAvatar::resetAnimations()
flushAllMotions();
}
-// Override selectively based on avatar sex and whether we're using new
-// animations.
+//-----------------------------------------------------------------------------
+// remapMotionID()
+// Override selectively based on avatar sex and whether we're using new animations.
+//-----------------------------------------------------------------------------
+// virtual
LLUUID LLVOAvatar::remapMotionID(const LLUUID& id)
{
static LLCachedControl<bool> use_new_walk_run(gSavedSettings, "UseNewWalkRun");
@@ -6262,7 +6264,6 @@ LLUUID LLVOAvatar::remapMotionID(const LLUUID& id)
}
return result;
-
}
//-----------------------------------------------------------------------------
@@ -6270,6 +6271,7 @@ LLUUID LLVOAvatar::remapMotionID(const LLUUID& id)
// id is the asset if of the animation to start
// time_offset is the offset into the animation at which to start playing
//-----------------------------------------------------------------------------
+// virtual
bool LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset)
{
LL_DEBUGS("Motion") << "motion requested " << id.asString() << " " << gAnimLibrary.animationName(id) << LL_ENDL;
@@ -6292,6 +6294,7 @@ bool LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset)
//-----------------------------------------------------------------------------
// stopMotion()
//-----------------------------------------------------------------------------
+// virtual
bool LLVOAvatar::stopMotion(const LLUUID& id, bool stop_immediate)
{
LL_DEBUGS("Motion") << "Motion requested " << id.asString() << " " << gAnimLibrary.animationName(id) << LL_ENDL;
@@ -6331,6 +6334,7 @@ void LLVOAvatar::stopMotionFromSource(const LLUUID& source_id)
//-----------------------------------------------------------------------------
// addDebugText()
//-----------------------------------------------------------------------------
+// virtual
void LLVOAvatar::addDebugText(const std::string& text)
{
mDebugText.append(1, '\n');
@@ -6338,8 +6342,22 @@ void LLVOAvatar::addDebugText(const std::string& text)
}
//-----------------------------------------------------------------------------
+// getDebugName()
+//-----------------------------------------------------------------------------
+// virtual
+std::string LLVOAvatar::getDebugName() const
+{
+#if LL_RELEASE_WITH_DEBUG_INFO
+ return getFullname();
+#else
+ return getID().asString();
+#endif // LL_RELEASE_WITH_DEBUG_INFO
+}
+
+//-----------------------------------------------------------------------------
// getID()
//-----------------------------------------------------------------------------
+// virtual
const LLUUID& LLVOAvatar::getID() const
{
return mID;
@@ -6349,6 +6367,7 @@ const LLUUID& LLVOAvatar::getID() const
// getJoint()
//-----------------------------------------------------------------------------
// RN: avatar joints are multi-rooted to include screen-based attachments
+// virtual
LLJoint *LLVOAvatar::getJoint( const std::string &name )
{
joint_map_t::iterator iter = mJointMap.find(name);
@@ -6464,6 +6483,7 @@ bool LLVOAvatar::jointIsRiggedTo(const LLJoint *joint) const
void LLVOAvatar::clearAttachmentOverrides()
{
+
for (S32 i=0; i<LL_CHARACTER_MAX_ANIMATED_JOINTS; i++)
{
LLJoint *pJoint = getJoint(i);
@@ -6494,6 +6514,7 @@ void LLVOAvatar::clearAttachmentOverrides()
//-----------------------------------------------------------------------------
void LLVOAvatar::rebuildAttachmentOverrides()
{
+
LL_DEBUGS("AnimatedObjects") << "rebuilding" << LL_ENDL;
clearAttachmentOverrides();
@@ -6542,6 +6563,7 @@ void LLVOAvatar::rebuildAttachmentOverrides()
// -----------------------------------------------------------------------------
void LLVOAvatar::updateAttachmentOverrides()
{
+
LL_DEBUGS("AnimatedObjects") << "updating" << LL_ENDL;
std::set<LLUUID> meshes_seen;
@@ -6617,11 +6639,11 @@ void LLVOAvatar::updateAttachmentOverrides()
}
}
pelvis_fixups = mPelvisFixups;
- //dumpArchetypeXML(getFullname() + "_paranoid_updated");
+ //dumpArchetypeXML(getDebugName() + "_paranoid_updated");
// Rebuild and compare
rebuildAttachmentOverrides();
- //dumpArchetypeXML(getFullname() + "_paranoid_rebuilt");
+ //dumpArchetypeXML(getDebugName() + "_paranoid_rebuilt");
bool mismatched = false;
for (S32 joint_num = 0; joint_num < LL_CHARACTER_MAX_ANIMATED_JOINTS; joint_num++)
{
@@ -6850,22 +6872,22 @@ void LLVOAvatar::showAttachmentOverrides(bool verbose) const
{
std::stringstream ss;
std::copy(pos_names.begin(), pos_names.end(), std::ostream_iterator<std::string>(ss, ","));
- LL_INFOS() << getFullname() << " attachment positions defined for joints: " << ss.str() << "\n" << LL_ENDL;
+ LL_INFOS() << avString() << " attachment positions defined for joints: " << ss.str() << "\n" << LL_ENDL;
}
else
{
- LL_DEBUGS("Avatar") << getFullname() << " no attachment positions defined for any joints" << "\n" << LL_ENDL;
+ LL_DEBUGS("Avatar") << avString() << " no attachment positions defined for any joints" << "\n" << LL_ENDL;
}
if (scale_names.size())
{
std::stringstream ss;
std::copy(scale_names.begin(), scale_names.end(), std::ostream_iterator<std::string>(ss, ","));
- LL_INFOS() << getFullname() << " attachment scales defined for joints: " << ss.str() << "\n" << LL_ENDL;
+ LL_INFOS() << getDebugName() << " attachment scales defined for joints: " << ss.str() << "\n" << LL_ENDL;
}
else
{
- LL_INFOS() << getFullname() << " no attachment scales defined for any joints" << "\n" << LL_ENDL;
+ LL_INFOS() << getDebugName() << " no attachment scales defined for any joints" << "\n" << LL_ENDL;
}
if (!verbose)
@@ -8252,7 +8274,7 @@ bool LLVOAvatar::getIsCloud() const
void LLVOAvatar::updateRezzedStatusTimers(S32 rez_status)
{
// State machine for rezzed status. Statuses are -1 on startup, 0
- // = cloud, 1 = gray, 2 = downloading, 3 = waiting for attachments, 4 = full.
+ // Statuses are -1 on startup, 0 = cloud, 1 = gray, 2 = downloading, 3 = waiting for attachments, 4 = full.
// Purpose is to collect time data for each it takes avatar to reach
// various loading landmarks: gray, textured (partial), textured fully.
@@ -8272,7 +8294,7 @@ void LLVOAvatar::updateRezzedStatusTimers(S32 rez_status)
if (rez_status < mLastRezzedStatus)
{
// load level has decreased. start phase timers for higher load levels.
- for (S32 i = rez_status+1; i <= mLastRezzedStatus; i++)
+ for (S32 i = rez_status + 1; i <= mLastRezzedStatus; i++)
{
startPhase("load_" + LLVOAvatar::rezStatusToString(i));
}
@@ -8280,7 +8302,7 @@ void LLVOAvatar::updateRezzedStatusTimers(S32 rez_status)
else if (rez_status > mLastRezzedStatus)
{
// load level has increased. stop phase timers for lower and equal load levels.
- for (S32 i = llmax(mLastRezzedStatus+1,1); i <= rez_status; i++)
+ for (S32 i = llmax(mLastRezzedStatus + 1, 1); i <= rez_status; i++)
{
stopPhase("load_" + LLVOAvatar::rezStatusToString(i));
stopPhase("first_load_" + LLVOAvatar::rezStatusToString(i), false);
@@ -8521,19 +8543,19 @@ bool LLVOAvatar::processFullyLoadedChange(bool loading)
F32 first_use_delay = FIRST_APPEARANCE_CLOUD_MIN_DELAY;
if (!isSelf() && loading)
{
- // Note that textures can causes 60s delay on thier own
- // so this delay might end up on top of textures' delay
- first_use_delay = llclamp(
- mFirstAppearanceMessageTimer.getElapsedTimeF32(),
- FIRST_APPEARANCE_CLOUD_MIN_DELAY,
- FIRST_APPEARANCE_CLOUD_MAX_DELAY);
+ // Note that textures can causes 60s delay on thier own
+ // so this delay might end up on top of textures' delay
+ first_use_delay = llclamp(
+ mFirstAppearanceMessageTimer.getElapsedTimeF32(),
+ FIRST_APPEARANCE_CLOUD_MIN_DELAY,
+ FIRST_APPEARANCE_CLOUD_MAX_DELAY);
- if (shouldImpostor())
- {
- // Impostors are less of a priority,
- // let them stay cloud longer
- first_use_delay *= FIRST_APPEARANCE_CLOUD_IMPOSTOR_MODIFIER;
- }
+ if (shouldImpostor())
+ {
+ // Impostors are less of a priority,
+ // let them stay cloud longer
+ first_use_delay *= FIRST_APPEARANCE_CLOUD_IMPOSTOR_MODIFIER;
+ }
}
mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > first_use_delay);
}
@@ -8550,12 +8572,12 @@ bool LLVOAvatar::processFullyLoadedChange(bool loading)
// did our loading state "change" from last call?
// FIXME runway - why are we updating every 30 calls even if nothing has changed?
// This causes updateLOD() to run every 30 frames, among other things.
+ bool fully_loaded_changed = (mFullyLoaded != mPreviousFullyLoaded);
const S32 UPDATE_RATE = 30;
bool changed =
((mFullyLoaded != mPreviousFullyLoaded) || // if the value is different from the previous call
- (!mFullyLoadedInitialized) || // if we've never been called before
- (mFullyLoadedFrameCounter % UPDATE_RATE == 0)); // every now and then issue a change
- bool fully_loaded_changed = (mFullyLoaded != mPreviousFullyLoaded);
+ (!mFullyLoadedInitialized) || // if we've never been called before
+ (mFullyLoadedFrameCounter % UPDATE_RATE == 0)); // every now and then issue a change
mPreviousFullyLoaded = mFullyLoaded;
mFullyLoadedInitialized = true;
@@ -8573,6 +8595,7 @@ bool LLVOAvatar::processFullyLoadedChange(bool loading)
mNeedsImpostorUpdate = true;
mLastImpostorUpdateReason = 6;
}
+
return changed;
}
@@ -9467,12 +9490,12 @@ void dump_visual_param(apr_file_t* file, LLVisualParam* viewer_param, F32 value)
void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix,
const LLAppearanceMessageContents& contents)
{
- std::string outfilename = get_sequential_numbered_file_name(dump_prefix,".xml");
+ std::string outfilename = get_sequential_numbered_file_name(dump_prefix, ".xml");
const std::vector<F32>& params_for_dump = contents.mParamWeights;
const LLTEContents& tec = contents.mTEContents;
LLAPRFile outfile;
- std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename);
+ std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, outfilename);
outfile.open(fullpath, LL_APR_WB );
apr_file_t* file = outfile.getFileHandle();
if (!file)
@@ -9685,7 +9708,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys )
static LLCachedControl<bool> enable_verbose_dumps(gSavedSettings, "DebugAvatarAppearanceMessage");
static LLCachedControl<bool> block_avatar_appearance_messages(gSavedSettings, "BlockAvatarAppearanceMessages");
- std::string dump_prefix = getFullname() + "_" + (isSelf()?"s":"o") + "_";
+ std::string dump_prefix = getDebugName() + (isSelf() ? "_s_" : "_o_");
if (block_avatar_appearance_messages)
{
LL_WARNS() << "Blocking AvatarAppearance message" << LL_ENDL;
@@ -10319,17 +10342,13 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara
std::string outprefix(prefix);
if (outprefix.empty())
{
- outprefix = getFullname() + (isSelf()?"_s":"_o");
+ outprefix = getDebugName() + (isSelf() ? "_s" : "_o");
}
- if (outprefix.empty())
- {
- outprefix = std::string("new_archetype");
- }
- std::string outfilename = get_sequential_numbered_file_name(outprefix,".xml");
+ std::string outfilename = get_sequential_numbered_file_name(outprefix, ".xml");
LLAPRFile outfile;
LLWearableType *wr_inst = LLWearableType::getInstance();
- std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,outfilename);
+ std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, outfilename);
if (APR_SUCCESS == outfile.open(fullpath, LL_APR_WB ))
{
apr_file_t* file = outfile.getFileHandle();
@@ -10815,7 +10834,7 @@ void LLVOAvatar::updateRiggingInfo()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR;
- LL_DEBUGS("RigSpammish") << getFullname() << " updating rig tab" << LL_ENDL;
+ LL_DEBUGS("RigSpammish") << getDebugName() << " updating rig tab" << LL_ENDL;
// use a local static for scratch space to avoid reallocation here
static std::vector<LLVOVolume*> volumes;
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index a2232d21a2..6765b1fc5b 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -232,6 +232,7 @@ public:
virtual void onActiveOverrideMeshesChanged();
/*virtual*/ const LLUUID& getID() const;
+ /*virtual*/ std::string getDebugName() const;
/*virtual*/ void addDebugText(const std::string& text);
/*virtual*/ F32 getTimeDilation();
/*virtual*/ void getGround(const LLVector3 &inPos, LLVector3 &outPos, LLVector3 &outNorm);
@@ -329,16 +330,16 @@ public:
// avatar render cost
- U32 getVisualComplexity() { return mVisualComplexity; };
+ U32 getVisualComplexity() { return mVisualComplexity; };
// surface area calculation
- F32 getAttachmentSurfaceArea() { return mAttachmentSurfaceArea; };
+ F32 getAttachmentSurfaceArea() { return mAttachmentSurfaceArea; };
- U32 getReportedVisualComplexity() { return mReportedVisualComplexity; }; // Numbers as reported by the SL server
- void setReportedVisualComplexity(U32 value) { mReportedVisualComplexity = value; };
+ U32 getReportedVisualComplexity() { return mReportedVisualComplexity; }; // Numbers as reported by the SL server
+ void setReportedVisualComplexity(U32 value) { mReportedVisualComplexity = value; };
- S32 getUpdatePeriod() { return mUpdatePeriod; };
- const LLColor4 & getMutedAVColor() { return mMutedAVColor; };
+ S32 getUpdatePeriod() { return mUpdatePeriod; };
+ const LLColor4 & getMutedAVColor() { return mMutedAVColor; };
static void updateImpostorRendering(U32 newMaxNonImpostorsValue);
void idleUpdateBelowWater();
@@ -402,12 +403,11 @@ public:
virtual bool getIsCloud() const;
bool isFullyTextured() const;
bool hasGray() const;
- S32 getRezzedStatus() const; // 0 = cloud, 1 = gray, 2 = textured, 3 = textured and fully downloaded.
+ S32 getRezzedStatus() const; // 0 = cloud, 1 = gray, 2 = textured, 3 = waiting for attachments, 4 = full.
void updateRezzedStatusTimers(S32 status);
S32 mLastRezzedStatus;
-
void startPhase(const std::string& phase_name);
void stopPhase(const std::string& phase_name, bool err_check = true);
void clearPhases();
@@ -741,7 +741,7 @@ protected:
LLViewerTexLayerSet* getTexLayerSet(const U32 index) const { return dynamic_cast<LLViewerTexLayerSet*>(mBakedTextureDatas[index].mTexLayerSet); }
- LLLoadedCallbackEntry::source_callback_list_t mCallbackTextureList ;
+ LLLoadedCallbackEntry::source_callback_list_t mCallbackTextureList;
bool mLoadedCallbacksPaused;
S32 mLoadedCallbackTextures; // count of 'loaded' baked textures, filled from mCallbackTextureList
LLFrameTimer mLastTexCallbackAddedTime;
diff --git a/indra/newview/llvoicecallhandler.cpp b/indra/newview/llvoicecallhandler.cpp
index 25b0e69436..d2c947fef2 100644
--- a/indra/newview/llvoicecallhandler.cpp
+++ b/indra/newview/llvoicecallhandler.cpp
@@ -38,6 +38,11 @@ public:
{
}
+ virtual bool canHandleUntrusted(const LLSD &params, const LLSD &query_map, LLMediaCtrl *web, const std::string &nav_type)
+ {
+ return (nav_type == NAV_TYPE_CLICKED || nav_type == NAV_TYPE_EXTERNAL);
+ }
+
bool handle(const LLSD& params, const LLSD& query_map, const std::string& grid, LLMediaCtrl* web)
{
//Make sure we have some parameters
diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp
index cf128f381a..b3ac28eb7a 100644
--- a/indra/newview/llvoicechannel.cpp
+++ b/indra/newview/llvoicechannel.cpp
@@ -369,6 +369,12 @@ void LLVoiceChannel::resume()
{
if (sSuspendedVoiceChannel)
{
+ if (sSuspendedVoiceChannel->callStarted())
+ {
+ // should have channel data already, restart
+ sSuspendedVoiceChannel->setState(STATE_READY);
+ }
+ // won't do anything if call is already started
sSuspendedVoiceChannel->activate();
}
else
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 3fb7a3c156..4867a5c279 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1481,6 +1481,7 @@ bool LLVOVolume::calcLOD()
const LLVector3* box = avatar->getLastAnimExtents();
LLVector3 diag = box[1] - box[0];
radius = diag.magVec() * 0.5f;
+ LL_DEBUGS("DynamicBox") << avatar->getDebugName() << " diag " << diag << " radius " << radius << LL_ENDL;
}
else
{
@@ -1491,6 +1492,7 @@ bool LLVOVolume::calcLOD()
const LLVector3* box = avatar->getLastAnimExtents();
LLVector3 diag = box[1] - box[0];
radius = diag.magVec(); // preserve old BinRadius behavior - 2x off
+ LL_DEBUGS("DynamicBox") << avatar->getDebugName() << " diag " << diag << " radius " << radius << LL_ENDL;
}
if (distance <= 0.f || radius <= 0.f)
{
@@ -1555,11 +1557,16 @@ bool LLVOVolume::calcLOD()
mLODAdjustedDistance = distance;
+ static LLCachedControl<S32> debug_selection_lods(gSavedSettings, "DebugSelectionLODs", 0);
if (isHUDAttachment())
{
// HUDs always show at highest detail
cur_detail = 3;
}
+ else if (isSelected() && debug_selection_lods() >= 0)
+ {
+ cur_detail = llmin(debug_selection_lods(), 3);
+ }
else
{
cur_detail = computeLODDetail(ll_round(distance, 0.01f), ll_round(radius, 0.01f), lod_factor);
diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp
index 8ce1a745c3..8b0492ceed 100644
--- a/indra/newview/llwearableitemslist.cpp
+++ b/indra/newview/llwearableitemslist.cpp
@@ -195,6 +195,7 @@ LLPanelWearableOutfitItem::LLPanelWearableOutfitItem(LLViewerInventoryItem* item
// virtual
void LLPanelWearableOutfitItem::updateItem(const std::string& name,
+ bool favorite,
EItemState item_state)
{
std::string search_label = name;
@@ -225,7 +226,7 @@ void LLPanelWearableOutfitItem::updateItem(const std::string& name,
}
}
- LLPanelInventoryListItemBase::updateItem(search_label, item_state);
+ LLPanelInventoryListItemBase::updateItem(search_label, favorite, item_state);
}
//////////////////////////////////////////////////////////////////////////
@@ -452,6 +453,7 @@ LLPanelAttachmentListItem* LLPanelAttachmentListItem::create(LLViewerInventoryIt
}
void LLPanelAttachmentListItem::updateItem(const std::string& name,
+ bool favorite,
EItemState item_state)
{
std::string title_joint = name;
@@ -469,7 +471,7 @@ void LLPanelAttachmentListItem::updateItem(const std::string& name,
title_joint = title_joint + " (" + trans_name + ")";
}
- LLPanelInventoryListItemBase::updateItem(title_joint, item_state);
+ LLPanelInventoryListItemBase::updateItem(title_joint, favorite, item_state);
}
//////////////////////////////////////////////////////////////////////////
@@ -497,7 +499,7 @@ bool LLPanelDummyClothingListItem::postBuild()
addWidgetToRightSide("btn_add_panel");
setIconImage(LLInventoryIcon::getIcon(LLAssetType::AT_CLOTHING, LLInventoryType::IT_NONE, mWearableType, false));
- updateItem(wearableTypeToString(mWearableType));
+ updateItem(wearableTypeToString(mWearableType), false);
// Make it look loke clothing item - reserve space for 'delete' button
setLeftWidgetsWidth(getChildView("item_icon")->getRect().mLeft);
@@ -931,8 +933,8 @@ LLContextMenu* LLWearableItemsList::ContextMenu::createMenu()
registrar.add("Wearable.CreateNew", boost::bind(createNewWearable, selected_id));
registrar.add("Wearable.ShowOriginal", boost::bind(show_item_original, selected_id));
registrar.add("Wearable.TakeOffDetach",
- boost::bind(&LLAppearanceMgr::removeItemsFromAvatar, LLAppearanceMgr::getInstance(), ids, no_op));
+ boost::bind(&LLAppearanceMgr::removeItemsFromAvatar, LLAppearanceMgr::getInstance(), ids, no_op));
// Register handlers for clothing.
registrar.add("Clothing.TakeOff",
boost::bind(&LLAppearanceMgr::removeItemsFromAvatar, LLAppearanceMgr::getInstance(), ids, no_op));
@@ -942,6 +944,7 @@ LLContextMenu* LLWearableItemsList::ContextMenu::createMenu()
// Register handlers for attachments.
registrar.add("Attachment.Detach",
boost::bind(&LLAppearanceMgr::removeItemsFromAvatar, LLAppearanceMgr::getInstance(), ids, no_op));
+ registrar.add("Attachment.Favorite", boost::bind(toggle_favorites, ids));
registrar.add("Attachment.Touch", boost::bind(handle_attachment_touch, selected_id));
registrar.add("Attachment.Profile", boost::bind(show_item_profile, selected_id));
registrar.add("Object.Attach", boost::bind(LLViewerAttachMenu::attachObjects, ids, _2));
@@ -975,6 +978,8 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
U32 n_touchable = 0; // number of touchable items among the selected ones
bool can_be_worn = true;
+ bool can_favorite = false;
+ bool can_unfavorite = false;
for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it)
{
@@ -996,6 +1001,12 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
const bool is_editable = get_is_item_editable(id);
const bool is_touchable = enable_attachment_touch(id);
const bool is_already_worn = gAgentWearables.selfHasWearable(wearable_type);
+
+ LLUUID linked_id = item->getLinkedUUID();
+ LLViewerInventoryItem* linked_item = gInventory.getItem(linked_id);
+ can_favorite |= !linked_item->getIsFavorite();
+ can_unfavorite |= linked_item->getIsFavorite();
+
if (is_worn)
{
++n_worn;
@@ -1019,7 +1030,7 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
if (can_be_worn)
{
- can_be_worn = get_can_item_be_worn(item->getLinkedUUID());
+ can_be_worn = get_can_item_be_worn(linked_id);
}
} // for
@@ -1041,6 +1052,8 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
setMenuItemEnabled(menu, "create_new", LLAppearanceMgr::instance().canAddWearables(ids));
setMenuItemVisible(menu, "show_original", !standalone);
setMenuItemEnabled(menu, "show_original", n_items == 1 && n_links == n_items);
+ setMenuItemVisible(menu, "favorites_add", can_favorite);
+ setMenuItemVisible(menu, "favorites_remove", can_unfavorite);
setMenuItemVisible(menu, "take_off", mask == MASK_CLOTHING && n_worn == n_items);
setMenuItemVisible(menu, "detach", mask == MASK_ATTACHMENT && n_worn == n_items);
setMenuItemVisible(menu, "take_off_or_detach", mask == (MASK_ATTACHMENT|MASK_CLOTHING));
diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h
index 3fe1059176..7ba64c90da 100644
--- a/indra/newview/llwearableitemslist.h
+++ b/indra/newview/llwearableitemslist.h
@@ -94,6 +94,7 @@ public:
* Updates item name and (worn) suffix.
*/
/*virtual*/ void updateItem(const std::string& name,
+ bool favorite,
EItemState item_state = IS_DEFAULT);
void onAddWearable();
@@ -147,6 +148,7 @@ public:
/** Set item title. Joint name is added to the title in parenthesis */
/*virtual*/ void updateItem(const std::string& name,
+ bool favorite,
EItemState item_state = IS_DEFAULT);
protected:
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 076459a7b2..6b3a5b1892 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -121,7 +121,7 @@
#include "SMAAAreaTex.h"
#include "SMAASearchTex.h"
-
+#include "llerror.h"
#ifndef LL_WINDOWS
#define A_GCC 1
#pragma GCC diagnostic ignored "-Wunused-function"
@@ -601,7 +601,6 @@ void LLPipeline::init()
connectRefreshCachedSettingsSafe("RenderMirrors");
connectRefreshCachedSettingsSafe("RenderHeroProbeUpdateRate");
connectRefreshCachedSettingsSafe("RenderHeroProbeConservativeUpdateMultiplier");
- connectRefreshCachedSettingsSafe("RenderAutoHideSurfaceAreaLimit");
LLPointer<LLControlVariable> cntrl_ptr = gSavedSettings.getControl("CollectFontVertexBuffers");
if (cntrl_ptr.notNull())
@@ -1291,8 +1290,11 @@ void LLPipeline::createGLBuffers()
}
allocateScreenBuffer(resX, resY);
- mRT->width = 0;
- mRT->height = 0;
+ // Do not zero out mRT dimensions here. allocateScreenBuffer() above
+ // already sets the correct dimensions. Zeroing them caused resizeShadowTexture()
+ // to fail if called immediately after createGLBuffers (e.g., post graphics change).
+ // mRT->width = 0;
+ // mRT->height = 0;
if (!mNoiseMap)
diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml
index bc9aef8974..f5d10ee8d2 100644
--- a/indra/newview/skins/default/colors.xml
+++ b/indra/newview/skins/default/colors.xml
@@ -458,6 +458,9 @@
name="InventoryBackgroundColor"
reference="DkGray2" />
<color
+ name="InventoryFavoriteColor"
+ reference="Yellow" />
+ <color
name="InventoryFocusOutlineColor"
reference="White_25" />
<color
diff --git a/indra/newview/skins/default/textures/icons/Icon_Pointer.png b/indra/newview/skins/default/textures/icons/Icon_Pointer.png
new file mode 100644
index 0000000000..021942a8aa
--- /dev/null
+++ b/indra/newview/skins/default/textures/icons/Icon_Pointer.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Content.png b/indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Content.png
new file mode 100644
index 0000000000..b71b202234
--- /dev/null
+++ b/indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Content.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Full.png b/indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Full.png
new file mode 100644
index 0000000000..7d55fb5cfe
--- /dev/null
+++ b/indra/newview/skins/default/textures/icons/Inv_Favorite_Star_Full.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index f824816183..64e2b417fa 100644
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -87,7 +87,7 @@ with the same filename but different name
<texture name="BreadCrumbBtn_Left_Off" file_name="widgets/BreadCrumbBtn_Left_Off.png" preload="false"/>
<texture name="BreadCrumbBtn_Left_Over" file_name="widgets/BreadCrumbBtn_Left_Over.png" preload="false"/>
<texture name="BreadCrumbBtn_Left_Press" file_name="widgets/BreadCrumbBtn_Left_Press.png" preload="false"/>
-
+
<texture name="BreadCrumbBtn_Middle_Disabled" file_name="widgets/BreadCrumbBtn_Middle_Disabled.png" preload="false"/>
<texture name="BreadCrumbBtn_Middle_Off" file_name="widgets/BreadCrumbBtn_Middle_Off.png" preload="false"/>
<texture name="BreadCrumbBtn_Middle_Over" file_name="widgets/BreadCrumbBtn_Middle_Over.png" preload="false"/>
@@ -194,7 +194,7 @@ with the same filename but different name
<texture name="Copy" file_name="icons/Copy.png" preload="false" />
<texture name="CopyBright" file_name="icons/CopyBright.png" preload="false" />
-
+
<texture name="DisclosureArrow_Opened_Off" file_name="widgets/DisclosureArrow_Opened_Off.png" preload="true" />
<texture name="ChatBarHandle" file_name="bottomtray/ChatBarHandle.png" preload="false" />
@@ -246,7 +246,7 @@ with the same filename but different name
<texture name="Group_Notices" file_name="icons/Group_Notices.png" preload="false" />
<texture name="Hand" file_name="icons/hand.png" preload="false" />
-
+
<texture name="Help_Press" file_name="navbar/Help_Press.png" preload="false" />
<texture name="Hierarchy_View_Disabled" file_name="icons/Hierarchy_View_Disabled.png" preload="false" />
@@ -259,16 +259,16 @@ with the same filename but different name
<texture name="Icon_Close_Foreground" file_name="windows/Icon_Close_Foreground.png" preload="true" />
<texture name="Icon_Close_Press" file_name="windows/Icon_Close_Press.png" preload="true" />
<texture name="Icon_Close_Toast" file_name="windows/Icon_Close_Toast.png" preload="true" />
-
+
<texture name="Icon_Copy" file_name="icons/copy_clipboard.png" preload="true" />
-
+
<texture name="Icon_Delete" file_name="icons/delete_icon.png" preload="true" />
<texture name="Icon_Dock_Foreground" file_name="windows/Icon_Dock_Foreground.png" preload="true" />
<texture name="Icon_Dock_Press" file_name="windows/Icon_Dock_Press.png" preload="true" />
<texture name="Icon_File_Upload" file_name="icons/file_upload.png" preload="true" />
-
+
<texture name="Icon_For_Sale" file_name="icons/Icon_For_Sale.png" preload="false" />
<texture name="Icon_Gear_Background" file_name="windows/Icon_Gear_Background.png" preload="false" />
@@ -281,14 +281,14 @@ with the same filename but different name
<texture name="Icon_Minimize_Foreground" file_name="windows/Icon_Minimize_Foreground.png" preload="true" />
<texture name="Icon_Minimize_Press" file_name="windows/Icon_Minimize_Press.png" preload="true" />
-
+
<texture name="Icon_Paste" file_name="icons/paste_clipboard.png" preload="true" />
<texture name="Icon_Restore_Foreground" file_name="windows/Icon_Restore_Foreground.png" preload="false" />
<texture name="Icon_Restore_Press" file_name="windows/Icon_Restore_Press.png" preload="false" />
<texture name="Icon_Snapshot" file_name="icons/snapshot_icon.png" preload="true" />
-
+
<texture name="Icon_Use_Texture" file_name="icons/texture_icon.png" preload="true" />
<texture name="Info" file_name="icons/Info.png" preload="false" />
@@ -308,6 +308,8 @@ with the same filename but different name
<texture name="Inv_CallingCard" file_name="icons/Inv_CallingCard.png" preload="false" />
<texture name="Inv_Clothing" file_name="icons/Inv_Clothing.png" preload="false" />
<texture name="Inv_Eye" file_name="icons/Inv_Eye.png" preload="false" />
+ <texture name="Inv_Favorite_Star_Content" file_name="icons/Inv_Favorite_Star_Content.png" preload="false" />
+ <texture name="Inv_Favorite_Star_Full" file_name="icons/Inv_Favorite_Star_Full.png" preload="false" />
<texture name="Inv_FolderClosed" file_name="icons/Inv_FolderClosed.png" preload="false" />
<texture name="Inv_FolderOpen" file_name="icons/Inv_FolderOpen.png" preload="false" />
<texture name="Inv_Gesture" file_name="icons/Inv_Gesture.png" preload="false" />
@@ -322,7 +324,7 @@ with the same filename but different name
<texture name="Inv_LostOpen" file_name="icons/Inv_LostOpen.png" preload="false" />
<texture name="Inv_Landmark" file_name="icons/Inv_Landmark.png" preload="false" />
<texture name="Inv_Material" file_name="icons/Inv_Material.png" preload="false" />
- <texture name="Inv_Mesh" file_name="icons/Inv_Mesh.png" preload="false" />
+ <texture name="Inv_Mesh" file_name="icons/Inv_Mesh.png" preload="false" />
<texture name="Inv_Notecard" file_name="icons/Inv_Notecard.png" preload="false" />
<texture name="Inv_Object" file_name="icons/Inv_Object.png" preload="false" />
<texture name="Inv_Object_Multi" file_name="icons/Inv_Object_Multi.png" preload="false" />
@@ -377,7 +379,7 @@ with the same filename but different name
<texture name="Locked_Icon" file_name="icons/Locked_Icon.png" preload="false" />
<texture name="Map_Placeholder_Icon" file_name="icons/map_placeholder.png" preload="true" />
-
+
<texture name="Marketplace_Dropzone_Background" file_name="widgets/Marketplace_Dropzone_Background.png" preload="true" />
<texture name="MarketplaceBtn_Off" file_name="widgets/MarketplaceBtn_Off.png" preload="true" scale.left="30" scale.top="19" scale.right="35" scale.bottom="4" />
<texture name="MarketplaceBtn_Selected" file_name="widgets/MarketplaceBtn_Selected.png" preload="true" scale.left="30" scale.top="19" scale.right="35" scale.bottom="4" />
@@ -393,7 +395,7 @@ with the same filename but different name
<texture name="ModelImport_Status_Good" file_name="green_checkmark.png" preload="false"/>
<texture name="ModelImport_Status_Warning" file_name="lag_status_warning.tga" preload="false"/>
<texture name="ModelImport_Status_Error" file_name="red_x.png" preload="false"/>
-
+
<texture name="MouseLook_View_Off" file_name="bottomtray/Mouselook_View_Off.png" preload="false" />
<texture name="MouseLook_View_On" file_name="bottomtray/Mouselook_View_On.png" preload="false" />
@@ -549,7 +551,7 @@ with the same filename but different name
<texture name="Profile_Perm_Objects_Enabled" file_name="icons/Profile_Perm_Objects_Enabled.png" preload="true"/>
<texture name="Profile_Perm_Online_Disabled" file_name="icons/Profile_Perm_Online_Disabled.png" preload="true"/>
<texture name="Profile_Perm_Online_Enabled" file_name="icons/Profile_Perm_Online_Enabled.png" preload="true"/>
-
+
<texture name="ProgressBar" file_name="widgets/ProgressBar.png" preload="true" scale.left="4" scale.top="11" scale.right="48" scale.bottom="3" />
<texture name="ProgressBarSolid" file_name="widgets/ProgressBarSolid.png" preload="true" scale.left="4" scale.top="11" scale.right="48" scale.bottom="3" />
<texture name="ProgressTrack" file_name="widgets/ProgressTrack.png" preload="true" scale.left="4" scale.top="13" scale.right="148" scale.bottom="2" />
@@ -742,7 +744,7 @@ with the same filename but different name
<texture name="UpArrow_Off" file_name="icons/UpArrow_Off.png" preload="false" />
<texture name="Video_URL_Off" file_name="icons/Video_URL_Off.png" preload="true" />
-
+
<texture name="Vertical Drag Handle" file_name="widgets/vertical_drag_handle.png" scale.left="2" scale.right="7" scale.bottom="8" scale.top="120" scale_type="scale_outer"/>
<texture name="VirtualTrackball_Moon_Back" file_name="widgets/track_control_moon_back.png" />
@@ -758,7 +760,7 @@ with the same filename but different name
<texture name="VirtualTrackball_Sphere" file_name="widgets/track_control_sphere.png" />
<texture name="VirtualTrackball_Sun_Back" file_name="widgets/track_control_sun_back.png" />
<texture name="VirtualTrackball_Sun_Front" file_name="widgets/track_control_sun_front.png" />
-
+
<texture name="Volume_Background" file_name="windows/Volume_Background.png" preload="false"
scale.left="6" scale.top="33" scale.right="63" scale.bottom="10" />
@@ -767,7 +769,7 @@ with the same filename but different name
<texture name="VoicePTT_Lvl3" file_name="bottomtray/VoicePTT_Lvl3.png" preload="false" />
<texture name="VoicePTT_Off" file_name="bottomtray/VoicePTT_Off.png" preload="false" />
<texture name="VoicePTT_On" file_name="bottomtray/VoicePTT_On.png" preload="false" />
-
+
<texture name="Wearables_Divider" file_name="windows/Wearables_Divider.png" preload="false" />
<texture name="Add_Icon" file_name="icons/add_icon.png" preload="false" />
@@ -882,7 +884,7 @@ with the same filename but different name
<texture name="buy_off" file_name="widgets/buy_off.png" preload="true" scale.left="2" scale.top="15" scale.right="67" scale.bottom="4"/>
<texture name="buy_over" file_name="widgets/buy_over.png" preload="true" scale.left="2" scale.top="15" scale.right="67" scale.bottom="4"/>
<texture name="buy_press" file_name="widgets/buy_press.png" preload="true" scale.left="2" scale.top="15" scale.right="67" scale.bottom="4"/>
-
+
<texture name="hint_background" file_name="windows/hint_background.png" preload="false" scale.left="8" scale.top="70" scale.right="195" scale.bottom="11"/>
<texture name="hint_arrow_left" file_name="windows/hint_arrow_left.png" preload="false"/>
<texture name="hint_arrow_right" file_name="windows/hint_arrow_right.png" preload="false"/>
@@ -931,4 +933,5 @@ with the same filename but different name
<texture name="ProgressLarge_11" file_name="icons/ProgressLarge_11.png" preload="true" />
<texture name="ProgressLarge_12" file_name="icons/ProgressLarge_12.png" preload="true" />
+ <texture name="Icon_Pointer" file_name="icons/Icon_Pointer.png" preload="false"/>
</textures>
diff --git a/indra/newview/skins/default/xui/da/strings.xml b/indra/newview/skins/default/xui/da/strings.xml
index a7dff91311..038a2e0fcd 100644
--- a/indra/newview/skins/default/xui/da/strings.xml
+++ b/indra/newview/skins/default/xui/da/strings.xml
@@ -3723,6 +3723,10 @@ Hvis du bliver ved med at modtage denne besked, kontakt venligst [SUPPORT_SITE].
<string name="conference-title-incoming">
Konference med [AGENT_NAME]
</string>
+ <string name="bot_warning">
+Du chatter med en bot, [NAME]. Del ikke personlige oplysninger.
+Læs mere på https://second.life/scripted-agents.
+ </string>
<string name="no_session_message">
(IM session eksisterer ikke)
</string>
diff --git a/indra/newview/skins/default/xui/de/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/de/panel_snapshot_inventory.xml
index 602424821f..09447cbbaf 100644
--- a/indra/newview/skins/default/xui/de/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/de/panel_snapshot_inventory.xml
@@ -7,7 +7,7 @@
<combo_box.item label="Klein (128x128)" name="Small(128x128)"/>
<combo_box.item label="Mittel (256x256)" name="Medium(256x256)"/>
<combo_box.item label="Groß (512x512)" name="Large(512x512)"/>
- <combo_box.item label="Aktuelles Fenster (512x512)" name="CurrentWindow"/>
+ <combo_box.item label="Aktuelles Fenster" name="CurrentWindow"/>
<combo_box.item label="Benutzerdefiniert" name="Custom"/>
</combo_box>
<spinner label="Breite x Höhe" name="inventory_snapshot_width"/>
diff --git a/indra/newview/skins/default/xui/de/panel_snapshot_options.xml b/indra/newview/skins/default/xui/de/panel_snapshot_options.xml
index dab20d63eb..2a51f10894 100644
--- a/indra/newview/skins/default/xui/de/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/de/panel_snapshot_options.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="panel_snapshot_options">
<button label="Auf Datenträger speichern" name="save_to_computer_btn"/>
- <button label="In Inventar speichern ([AMOUNT] L$)" name="save_to_inventory_btn"/>
+ <button label="In Inventar speichern" name="save_to_inventory_btn"/>
<button label="Im Profil-Feed teilen" name="save_to_profile_btn"/>
<button label="Auf Facebook teilen" name="send_to_facebook_btn"/>
<button label="Auf Twitter teilen" name="send_to_twitter_btn"/>
diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml
index 4bed43dd1d..c7f664f29b 100644
--- a/indra/newview/skins/default/xui/de/strings.xml
+++ b/indra/newview/skins/default/xui/de/strings.xml
@@ -1613,6 +1613,10 @@ Falls diese Meldung weiterhin angezeigt wird, wenden Sie sich bitte an [SUPPORT_
<string name="conference-title-incoming">Konferenz mit [AGENT_NAME]</string>
<string name="inventory_item_offered-im">Inventarobjekt „[ITEM_NAME]“ angeboten</string>
<string name="inventory_folder_offered-im">Inventarordner „[ITEM_NAME]“ angeboten</string>
+ <string name="bot_warning">
+ Sie chatten mit einem Bot, [NAME]. Geben Sie keine persönlichen Informationen weiter.
+Erfahren Sie mehr unter https://second.life/scripted-agents.
+ </string>
<string name="share_alert">Objekte aus dem Inventar hier her ziehen</string>
<string name="facebook_post_success">Sie haben auf Facebook gepostet.</string>
<string name="flickr_post_success">Sie haben auf Flickr gepostet.</string>
diff --git a/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml b/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml
deleted file mode 100644
index 6c3214a76d..0000000000
--- a/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml
+++ /dev/null
@@ -1,421 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes"?>
-<floater
- legacy_header_height="18"
- height="340"
- layout="topleft"
- name="item properties"
- help_topic="item_properties"
- save_rect="true"
- title="INVENTORY ITEM PROPERTIES"
- width="350">
- <floater.string
- name="unknown">
- (unknown)
- </floater.string>
- <floater.string
- name="public">
- (public)
- </floater.string>
- <floater.string
- name="you_can">
- You can:
- </floater.string>
- <floater.string
- name="owner_can">
- Owner can:
- </floater.string>
- <floater.string
- name="acquiredDate">
- [wkday,datetime,local] [mth,datetime,local] [day,datetime,local] [hour,datetime,local]:[min,datetime,local]:[second,datetime,local] [year,datetime,local]
- </floater.string>
- <icon
- follows="top|right"
- height="18"
- image_name="Lock"
- layout="topleft"
- left="276"
- mouse_opaque="true"
- name="IconLocked"
- top="4"
- width="18" />
- <text
- type="string"
- length="1"
- follows="left|top"
- height="10"
- layout="topleft"
- left="10"
- name="LabelItemNameTitle"
- top="25"
- width="78">
- Name:
- </text>
- <line_editor
- border_style="line"
- border_thickness="1"
- follows="left|top|right"
- height="16"
- layout="topleft"
- left_delta="78"
- max_length_bytes="63"
- name="LabelItemName"
- top_delta="0"
- width="252" />
- <text
- type="string"
- length="1"
- follows="left|top"
- height="10"
- layout="topleft"
- left="10"
- name="LabelItemDescTitle"
- top="45"
- width="78">
- Description:
- </text>
- <line_editor
- border_style="line"
- border_thickness="1"
- follows="left|top|right"
- height="16"
- layout="topleft"
- left_delta="78"
- max_length_bytes="127"
- name="LabelItemDesc"
- top_delta="0"
- width="252" />
- <text
- type="string"
- length="1"
- follows="left|top"
- height="16"
- layout="topleft"
- left="10"
- name="LabelCreatorTitle"
- top="65"
- width="78">
- Creator:
- </text>
- <text
- type="string"
- length="1"
- follows="left|top"
- height="16"
- layout="topleft"
- left_delta="78"
- name="LabelCreatorName"
- top_delta="0"
- translate="false"
- use_ellipses="true"
- width="170">
- TestString PleaseIgnore
- </text>
- <button
- follows="top|right"
- height="16"
- label="Profile..."
- layout="topleft"
- left_delta="174"
- name="BtnCreator"
- top_delta="0"
- width="78" />
- <text
- type="string"
- length="1"
- follows="left|top"
- height="16"
- layout="topleft"
- left="10"
- name="LabelOwnerTitle"
- top="85"
- width="78">
- Owner:
- </text>
- <text
- type="string"
- length="1"
- follows="left|top"
- height="16"
- layout="topleft"
- left_delta="78"
- name="LabelOwnerName"
- top_delta="0"
- translate="false"
- use_ellipses="true"
- width="170">
- TestString PleaseIgnore
- </text>
- <button
- follows="top|right"
- height="16"
- label="Profile..."
- layout="topleft"
- left_delta="174"
- name="BtnOwner"
- top_delta="0"
- width="78" />
- <text
- type="string"
- length="1"
- follows="left|top"
- height="16"
- layout="topleft"
- left="10"
- name="LabelAcquiredTitle"
- top="105"
- width="78">
- Acquired:
- </text>
- <text
- type="string"
- length="1"
- follows="left|top"
- height="16"
- layout="topleft"
- left_delta="78"
- name="LabelAcquiredDate"
- top_delta="0"
- width="252">
- Wed May 24 12:50:46 2006
- </text>
- <text
- type="string"
- length="1"
- follows="left|top"
- height="10"
- layout="topleft"
- left="10"
- name="OwnerLabel"
- top="125"
- width="78">
- You:
- </text>
- <check_box
- height="16"
- label="Edit"
- layout="topleft"
- left_pad="5"
- name="CheckOwnerModify"
- top_delta="0"
- width="78" />
- <check_box
- height="16"
- label="Copy"
- layout="topleft"
- left_delta="0"
- name="CheckOwnerCopy"
- top_pad="5"
- width="88" />
- <check_box
- height="16"
- label="Resell"
- layout="topleft"
- left_delta="0"
- name="CheckOwnerTransfer"
- top_pad="5"
- width="106" />
- <text
- type="string"
- length="1"
- follows="left|top"
- height="10"
- layout="topleft"
- left="10"
- name="AnyoneLabel"
- top_pad="5"
- width="78">
- Anyone:
- </text>
- <check_box
- height="16"
- label="Copy"
- layout="topleft"
- left_pad="5"
- name="CheckEveryoneCopy"
- top_delta="0"
- width="130" />
- <text
- type="string"
- length="1"
- follows="left|top"
- height="10"
- layout="topleft"
- left="10"
- name="GroupLabel"
- top_pad="5"
- width="78">
- Group:
- </text>
- <check_box
- height="16"
- label="Share"
- layout="topleft"
- left_pad="5"
- name="CheckShareWithGroup"
- top_delta="5"
- width="106" />
- <text
- type="string"
- length="1"
- follows="left|top"
- height="25"
- layout="topleft"
- left="10"
- name="NextOwnerLabel"
- top_pad="5"
- width="78"
- word_wrap="true">
- Next owner:
- </text>
- <check_box
- height="16"
- label="Edit"
- layout="topleft"
- left_pad="5"
- name="CheckNextOwnerModify"
- top_delta="0"
- width="78" />
- <check_box
- height="16"
- label="Copy"
- layout="topleft"
- left_delta="0"
- name="CheckNextOwnerCopy"
- top_pad="5"
- width="88" />
- <check_box
- height="16"
- label="Resell"
- layout="topleft"
- left_delta="0"
- name="CheckNextOwnerTransfer"
- top_pad="5"
- width="106" />
- <check_box
- height="16"
- label="For Sale"
- layout="topleft"
- left="10"
- name="CheckPurchase"
- top_pad="5"
- width="78" />
- <combo_box
- height="19"
- left_pad="5"
- layout="topleft"
- follows="left|top"
- name="ComboBoxSaleType"
- width="110">
- <combo_box.item
- name="Copy"
- label="Copy"
- value="2" />
- <combo_box.item
- name="Contents"
- label="Contents"
- value="3" />
- <combo_box.item
- name="Original"
- label="Original"
- value="1" />
- </combo_box>
- <spinner
- follows="left|top"
- decimal_digits="0"
- increment="1"
- name="Edit Cost"
- label="Price:"
- label_width="100"
- left="10"
- width="192"
- min_val="1"
- height="19"
- max_val="999999999"
- top_pad="5"/>
- <text
- type="string"
- length="1"
- height="15"
- follows="left|top"
- layout="topleft"
- left_delta="82"
- name="CurrencySymbol"
- top_delta="1"
- width="18">
- L$
- </text>
-
- <!--line_editor
- border_style="line"
- border_thickness="1"
- follows="left|top|right"
- height="16"
- layout="topleft"
- left_pad="5"
- max_length_bytes="25"
- name="EditPrice"
- top_delta="0"
- width="242" /-->
-
- <!--text
- type="string"
- length="1"
- follows="left|top"
- height="10"
- layout="topleft"
- left="10"
- name="BaseMaskDebug"
- top="155"
- width="330">
- B:
- </text>
- <text
- type="string"
- length="1"
- follows="left|top"
- height="10"
- layout="topleft"
- left_delta="60"
- name="OwnerMaskDebug"
- top_delta="0"
- width="270">
- O:
- </text>
- <text
- type="string"
- length="1"
- follows="left|top"
- height="10"
- layout="topleft"
- left_delta="60"
- name="GroupMaskDebug"
- top_delta="0"
- width="210">
- G:
- </text>
- <text
- type="string"
- length="1"
- follows="left|top"
- height="10"
- layout="topleft"
- left_delta="60"
- name="EveryoneMaskDebug"
- top_delta="0"
- width="150">
- E:
- </text>
- <text
- type="string"
- length="1"
- follows="left|top"
- height="10"
- layout="topleft"
- left_delta="60"
- name="NextMaskDebug"
- top_delta="0"
- width="90">
- N:
- </text-->
-
-</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_inventory_settings.xml b/indra/newview/skins/default/xui/en/floater_inventory_settings.xml
index 156bba6c27..08b7a7af05 100644
--- a/indra/newview/skins/default/xui/en/floater_inventory_settings.xml
+++ b/indra/newview/skins/default/xui/en/floater_inventory_settings.xml
@@ -4,8 +4,8 @@
can_minimize="true"
can_resize="false"
save_rect="true"
- height="370"
- width="370"
+ height="483"
+ width="483"
name="inventory_settings"
title="INVENTORY SETTINGS">
<icon
@@ -16,7 +16,7 @@
left="18"
mouse_opaque="true"
name="multi_folder_icon"
- top="25"
+ top="20"
width="18" />
<text
type="string"
@@ -40,10 +40,10 @@
font="SansSerifMedium"
left="60"
width="300"
- height="70"
+ height="66"
name="multi_double_click_setting">
<radio_item
- height="20"
+ height="18"
label="Expands &amp; collapses folder"
label_text.text_color="White"
follows="left|top"
@@ -51,24 +51,24 @@
name="0"
width="200"/>
<radio_item
- height="20"
+ height="18"
follows="left|top"
label="Opens a new window"
label_text.text_color="White"
layout="topleft"
left_delta="0"
name="1"
- top_pad ="5"
+ top_pad ="3"
width="200" />
<radio_item
- height="20"
+ height="18"
follows="left|top"
label="Switches view"
label_text.text_color="White"
layout="topleft"
left_delta="0"
name="2"
- top_pad ="5"
+ top_pad ="3"
width="200" />
</radio_group>
<icon
@@ -79,7 +79,7 @@
left="18"
mouse_opaque="true"
name="single_folder_icon"
- top_pad="30"
+ top_pad="19"
width="18" />
<text
type="string"
@@ -103,10 +103,10 @@
font="SansSerifMedium"
left="60"
width="300"
- height="45"
+ height="44"
name="single_double_click_setting">
<radio_item
- height="20"
+ height="18"
label="Stays in current window"
label_text.text_color="White"
follows="left|top"
@@ -114,27 +114,37 @@
name="false"
width="200"/>
<radio_item
- height="20"
+ height="18"
follows="left|top"
label="Opens a new window"
label_text.text_color="White"
layout="topleft"
left_delta="0"
name="true"
- top_pad ="5"
+ top_pad ="3"
width="200" />
</radio_group>
+ <icon
+ follows="top|left"
+ height="15"
+ image_name="Icon_Pointer"
+ layout="topleft"
+ left="20"
+ mouse_opaque="true"
+ name="single_folder_icon"
+ top_pad="20"
+ width="15" />
<text
type="string"
length="1"
follows="left|top|right"
height="13"
layout="topleft"
- left="48"
+ left_pad="13"
name="find_original_txt"
font="SansSerifMedium"
text_color="White"
- top_pad="30"
+ top_delta="1"
width="300">
Clicking on "Show in inventory" or "Find original"
</text>
@@ -146,10 +156,10 @@
font="SansSerifMedium"
left="60"
width="300"
- height="45"
+ height="44"
name="find_original_settings">
<radio_item
- height="20"
+ height="18"
label="Shows item in main inventory window"
label_text.text_color="White"
follows="left|top"
@@ -157,23 +167,136 @@
name="false"
width="200"/>
<radio_item
- height="20"
+ height="18"
follows="left|top"
label="Opens a new single-folder window"
label_text.text_color="White"
layout="topleft"
left_delta="0"
name="true"
- top_pad ="5"
+ top_pad ="3"
width="200" />
</radio_group>
- <button
- height="20"
- label="OK"
- layout="topleft"
- left="140"
- bottom="-20"
- name="ok_btn"
- label_color="White"
- width="90" />
+ <icon
+ follows="top|left"
+ height="18"
+ image_name="Inv_Favorite_Star_Full"
+ layout="topleft"
+ left="18"
+ mouse_opaque="true"
+ name="favorites_icon"
+ top_pad="19"
+ width="18" />
+ <text
+ type="string"
+ length="1"
+ layout="topleft"
+ follows="left|top|right"
+ height="13"
+ left_pad="12"
+ top_delta="2"
+ name="favorites_txt"
+ font="SansSerifMedium"
+ text_color="White"
+ width="300">
+ Favorites
+ </text>
+ <check_box
+ control_name="InventoryFavoritesUseStar"
+ layout="topleft"
+ follows="left|top"
+ top_pad="8"
+ font="SansSerifMedium"
+ left="60"
+ width="300"
+ height="18"
+ label="Star on favorite items"
+ name="favorite_star"
+ label_text.text_color="White"
+ initial_value="false"/>
+ <check_box
+ control_name="InventoryFavoritesUseHollowStar"
+ follows="left|top"
+ top_pad="5"
+ layout="topleft"
+ font="SansSerifMedium"
+ left="60"
+ width="150"
+ height="18"
+ label="Star on folders containing a favorite"
+ name="favorite_hollow_star"
+ label_text.text_color="White"
+ initial_value="false"/>
+ <check_box
+ control_name="InventoryFavoritesColorText"
+ follows="left|top"
+ top_pad="5"
+ layout="topleft"
+ font="SansSerifMedium"
+ left="60"
+ width="150"
+ height="18"
+ label="Colored text"
+ name="favorites_color"
+ label_text.text_color="White"
+ initial_value="false"/>
+ <color_swatch
+ can_apply_immediately="true"
+ follows="left|top"
+ layout="topleft"
+ height="24"
+ label_height="0"
+ left_pad="40"
+ name="favorites_swatch"
+ top_delta="-6"
+ width="44" >
+ <color_swatch.init_callback
+ function="ScriptPref.getUIColor"
+ parameter="InventoryFavoriteColor" />
+ <color_swatch.commit_callback
+ function="ScriptPref.applyUIColor"
+ parameter="InventoryFavoriteColor" />
+ </color_swatch>
+ <icon
+ follows="top|left"
+ height="18"
+ image_name="Inv_Object"
+ layout="topleft"
+ left="18"
+ mouse_opaque="true"
+ name="obj_icon"
+ top_pad="19"
+ width="18" />
+ <text
+ type="string"
+ length="1"
+ follows="left|top|right"
+ height="13"
+ layout="topleft"
+ left_pad="12"
+ top_delta="2"
+ name="single_folder_txt"
+ font="SansSerifMedium"
+ text_color="White"
+ width="300">
+ Pressing return on an avatar attachment
+ </text>
+ <combo_box
+ control_name="InventoryAddAttachmentBehavior"
+ layout="topleft"
+ follows="left|top"
+ top_pad="8"
+ height="24"
+ left="60"
+ name="attach_combo"
+ width="300">
+ <combo_box.item
+ label="Adds attachment (recommended)"
+ name="0"
+ value="0"/>
+ <combo_box.item
+ label="Wear (removes attachment at that point)"
+ name="1"
+ value="1"/>
+ </combo_box>
</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_my_inventory.xml b/indra/newview/skins/default/xui/en/floater_my_inventory.xml
index a9900f05b7..881c1f7469 100644
--- a/indra/newview/skins/default/xui/en/floater_my_inventory.xml
+++ b/indra/newview/skins/default/xui/en/floater_my_inventory.xml
@@ -12,7 +12,7 @@
save_visibility="true"
reuse_instance="true"
title="INVENTORY"
- width="363" >
+ width="418" >
<panel
class="sidepanel_inventory"
name="main_panel"
diff --git a/indra/newview/skins/default/xui/en/floater_new_feature_notification.xml b/indra/newview/skins/default/xui/en/floater_new_feature_notification.xml
index 57b74b360a..9981e5d893 100644
--- a/indra/newview/skins/default/xui/en/floater_new_feature_notification.xml
+++ b/indra/newview/skins/default/xui/en/floater_new_feature_notification.xml
@@ -17,17 +17,7 @@
New inventory features
</floater.string>
<floater.string name="description_txt_inventory">
-You can now add preview images to inventory items and view a folder in its own window.
-Learn more in this [https://community.secondlife.com/blogs/entry/13637-new-features-inventory-item-preview-and-single-folder-view/ blogpost]
- </floater.string>
- <floater.string name="title_txt_gltf">
-New GLTF PBR materials support
- </floater.string>
- <floater.string name="description_txt_gltf">
-You can now use expanded material support with the ability to import and edit GLTF Physically Based Rendering (PBR) Materials.
-In order to support the addition of the GLTF format, some areas in the viewer may appear darker than usual.
-
-Learn more about [https://wiki.secondlife.com/wiki/PBR_Materials Physically Based Rendering (PBR)]
+You can now mark items and folders as favorites. Favorited items will appear in the Favorites tab of inventory and by default will be highlighted with a star in the main inventory view.
</floater.string>
<text
type="string"
diff --git a/indra/newview/skins/default/xui/en/floater_object_weights.xml b/indra/newview/skins/default/xui/en/floater_object_weights.xml
index 5e4b017590..709fbdd27e 100644
--- a/indra/newview/skins/default/xui/en/floater_object_weights.xml
+++ b/indra/newview/skins/default/xui/en/floater_object_weights.xml
@@ -2,7 +2,7 @@
<floater
can_close="true"
can_tear_off="false"
- height="289"
+ height="372"
help_topic="object_weights"
layout="topleft"
name="object_weights"
@@ -13,6 +13,21 @@
<floater.string
name="nothing_selected"
value="--"/>
+ <floater.string
+ name="lowest_lod"
+ value="Lowest"/>
+ <floater.string
+ name="low_lod"
+ value="Low"/>
+ <floater.string
+ name="medium_lod"
+ value="Medium"/>
+ <floater.string
+ name="high_lod"
+ value="High"/>
+ <floater.string
+ name="multiple_lods"
+ value="Multiple"/>
<text
follows="left|top"
@@ -320,4 +335,97 @@
top_delta="0"
value="Total capacity"
width="130" />
+
+
+ <text
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left="10"
+ name="rendering_info_text"
+ text_color="EmphasisColor"
+ top_pad="10"
+ value="RENDERING INFO"
+ width="180" />
+ <text
+ follows="left|top"
+ halign="right"
+ height="16"
+ layout="topleft"
+ left="10"
+ name="lod_level"
+ top_pad="3"
+ value="--"
+ width="40" />
+ <loading_indicator
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left="34"
+ name="lod_level_loading_indicator"
+ top_delta="0"
+ width="16" />
+ <text
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left_pad="10"
+ name="lod_level_label"
+ top_delta="0"
+ value="LOD (Level of detail)"
+ width="130" />
+ <text
+ follows="left|top"
+ halign="right"
+ height="16"
+ layout="topleft"
+ left="10"
+ name="triangles_shown"
+ top_pad="3"
+ value="--"
+ width="40" />
+ <loading_indicator
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left="34"
+ name="triangles_shown_loading_indicator"
+ top_delta="0"
+ width="16" />
+ <text
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left_pad="10"
+ name="triangles_shown_label"
+ top_delta="0"
+ value="Triangles Shown"
+ width="130" />
+ <text
+ follows="left|top"
+ halign="right"
+ height="16"
+ layout="topleft"
+ left="10"
+ name="pixel_area"
+ top_pad="3"
+ value="--"
+ width="40" />
+ <loading_indicator
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left="34"
+ name="pixel_area_loading_indicator"
+ top_delta="0"
+ width="16" />
+ <text
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left_pad="10"
+ name="pixel_area_label"
+ top_delta="0"
+ value="Pixel Area"
+ width="130" />
</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml
index 88d6ae1bc2..9b637d60f2 100644
--- a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml
+++ b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml
@@ -1011,7 +1011,7 @@
layout="topleft"
left="420"
name="Mirrors"
- top_delta="24"
+ top_delta="22"
width="240">
<check_box.commit_callback
function="Pref.RenderOptionUpdate" />
@@ -1113,7 +1113,7 @@
max_val="1.0"
name="RenderSharpness"
show_text="true"
- top_delta="24"
+ top_delta="20"
width="260">
</slider>
<!-- End of Sharpening Settings-->
@@ -1164,7 +1164,7 @@
max_val="1.0"
name="TonemapMix"
show_text="true"
- top_delta="22"
+ top_delta="20"
width="260">
</slider>
<!-- End of Tone Mapping Settings-->
diff --git a/indra/newview/skins/default/xui/en/floater_preview_trash.xml b/indra/newview/skins/default/xui/en/floater_preview_trash.xml
index f1c87c8c5a..ebb5cd9251 100644
--- a/indra/newview/skins/default/xui/en/floater_preview_trash.xml
+++ b/indra/newview/skins/default/xui/en/floater_preview_trash.xml
@@ -29,6 +29,8 @@
bevel_style="none"
scroll.reserve_scroll_corner="false">
<folder folder_arrow_image="Folder_Arrow"
+ favorite_image="Inv_Favorite_Star_Full"
+ favorite_content_image="Inv_Favorite_Star_Content"
folder_indentation="8"
item_height="20"
item_top_pad="4"
diff --git a/indra/newview/skins/default/xui/en/floater_voice_chat_volume.xml b/indra/newview/skins/default/xui/en/floater_voice_chat_volume.xml
index 51809793d3..c0d260ef59 100644
--- a/indra/newview/skins/default/xui/en/floater_voice_chat_volume.xml
+++ b/indra/newview/skins/default/xui/en/floater_voice_chat_volume.xml
@@ -22,7 +22,7 @@
increment="0.025"
initial_value="0.5"
label="Voice Chat"
- label_width="50"
+ label_width="60"
layout="topleft"
left="15"
top="50"
diff --git a/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml b/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml
index 99f84fe808..d8ef139d37 100644
--- a/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml
+++ b/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml
@@ -670,6 +670,22 @@
function="Inventory.DoToSelected"
parameter="ungroup_folder_items" />
</menu_item_call>
+ <menu_item_call
+ label="Add to Favorites"
+ layout="topleft"
+ name="Add to Favorites">
+ <menu_item_call.on_click
+ function="Inventory.DoToSelected"
+ parameter="add_to_favorites" />
+ </menu_item_call>
+ <menu_item_call
+ label="Remove from Favorites"
+ layout="topleft"
+ name="Remove from Favorites">
+ <menu_item_call.on_click
+ function="Inventory.DoToSelected"
+ parameter="remove_from_favorites" />
+ </menu_item_call>
<menu
label="Use as default for"
layout="topleft"
@@ -725,6 +741,136 @@
<menu_item_call.on_visible
function="Inventory.CanSetFavoriteFolder" />
</menu_item_call>
+ <menu
+ label="Upload to folder"
+ layout="topleft"
+ name="upload_options">
+ <menu_item_call
+ label="Image..."
+ layout="topleft"
+ name="Upload Image">
+ <menu_item_call.on_click
+ function="Inventory.FileUploadLocation"
+ parameter="upload_texture" />
+ <menu_item_call.on_enable
+ function="File.EnableUpload" />
+ <menu_item_call.on_visible
+ function="Upload.CalculateCosts"
+ parameter="Upload Image,texture" />
+ </menu_item_call>
+ <menu_item_call
+ label="Sound (L$[COST])..."
+ layout="topleft"
+ name="Upload Sound">
+ <menu_item_call.on_click
+ function="Inventory.FileUploadLocation"
+ parameter="upload_sound" />
+ <menu_item_call.on_enable
+ function="File.EnableUpload" />
+ <menu_item_call.on_visible
+ function="Upload.CalculateCosts"
+ parameter="Upload Sound,sound" />
+ </menu_item_call>
+ <menu_item_call
+ label="Animation (L$[COST])..."
+ layout="topleft"
+ name="Upload Animation">
+ <menu_item_call.on_click
+ function="Inventory.FileUploadLocation"
+ parameter="upload_animation" />
+ <menu_item_call.on_enable
+ function="File.EnableUpload" />
+ <menu_item_call.on_visible
+ function="Upload.CalculateCosts"
+ parameter="Upload Animation,animation" />
+ </menu_item_call>
+ <menu_item_call
+ label="Model..."
+ layout="topleft"
+ name="Upload Model">
+ <menu_item_call.on_click
+ function="Inventory.FileUploadLocation"
+ parameter="upload_model" />
+ <menu_item_call.on_enable
+ function="File.EnableUploadModel" />
+ <menu_item_call.on_visible
+ function="File.VisibleUploadModel"/>
+ </menu_item_call>
+ <menu_item_call
+ label="Material..."
+ layout="topleft"
+ name="Upload Material">
+ <menu_item_call.on_click
+ function="Inventory.FileUploadLocation"
+ parameter="upload_pbr_material" />
+ <menu_item_call.on_enable
+ function="File.EnableUploadMaterial" />
+ </menu_item_call>
+ <menu_item_call
+ label="Bulk..."
+ layout="topleft"
+ name="Bulk Upload">
+ <menu_item_call.on_click
+ function="Inventory.FileUploadLocation"
+ parameter="upload_bulk" />
+ <menu_item_call.on_visible
+ function="Upload.CalculateCosts"
+ parameter="Bulk Upload,texture" />
+ </menu_item_call>
+ </menu>
+ <menu
+ label="Use as default for"
+ layout="topleft"
+ name="upload_def">
+ <menu_item_call
+ label="Image uploads"
+ layout="topleft"
+ name="Image uploads">
+ <menu_item_call.on_click
+ function="Inventory.FileUploadLocation"
+ parameter="def_texture" />
+ <menu_item_call.on_visible
+ function="Inventory.CanSetUploadLocation" />
+ </menu_item_call>
+ <menu_item_call
+ label="Sound uploads"
+ layout="topleft"
+ name="Sound uploads">
+ <menu_item_call.on_click
+ function="Inventory.FileUploadLocation"
+ parameter="def_sound" />
+ <menu_item_call.on_visible
+ function="Inventory.CanSetUploadLocation" />
+ </menu_item_call>
+ <menu_item_call
+ label="Animation uploads"
+ layout="topleft"
+ name="Animation uploads">
+ <menu_item_call.on_click
+ function="Inventory.FileUploadLocation"
+ parameter="def_animation" />
+ <menu_item_call.on_visible
+ function="Inventory.CanSetUploadLocation" />
+ </menu_item_call>
+ <menu_item_call
+ label="Model uploads"
+ layout="topleft"
+ name="Model uploads">
+ <menu_item_call.on_click
+ function="Inventory.FileUploadLocation"
+ parameter="def_model" />
+ <menu_item_call.on_visible
+ function="Inventory.CanSetUploadLocation" />
+ </menu_item_call>
+ <menu_item_call
+ label="PBR material uploads"
+ layout="topleft"
+ name="PBR uploads">
+ <menu_item_call.on_click
+ function="Inventory.FileUploadLocation"
+ parameter="def_pbr_material" />
+ </menu_item_call>
+ </menu>
<menu_item_separator
layout="topleft"
name="Marketplace Separator" />
diff --git a/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml b/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml
index 99cee83f4e..fb68193006 100755
--- a/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml
+++ b/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml
@@ -50,6 +50,26 @@
function="Outfit.Thumbnail" />
</menu_item_call>
<menu_item_call
+ label="Add to favorites"
+ layout="topleft"
+ name="favorites_add">
+ <on_visible
+ function="Outfit.OnVisible"
+ parameter="favorites_add" />
+ <on_click
+ function="Outfit.Favorite" />
+ </menu_item_call>
+ <menu_item_call
+ label="Remove from favorites"
+ layout="topleft"
+ name="favorites_remove">
+ <on_visible
+ function="Outfit.OnVisible"
+ parameter="favorites_remove" />
+ <on_click
+ function="Outfit.Favorite" />
+ </menu_item_call>
+ <menu_item_call
label="Edit outfit"
layout="topleft"
name="edit">
diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml
index e0f380e074..fdeefe9089 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory.xml
@@ -942,7 +942,7 @@
function="Inventory.EnvironmentEnabled" />
</menu_item_call>
</menu>
- </menu>
+ </menu>
<menu_item_call
label="Create folder from selected"
layout="topleft"
@@ -959,6 +959,99 @@
function="Inventory.DoToSelected"
parameter="ungroup_folder_items" />
</menu_item_call>
+ <menu_item_call
+ label="Add to Favorites"
+ layout="topleft"
+ name="Add to Favorites">
+ <menu_item_call.on_click
+ function="Inventory.DoToSelected"
+ parameter="add_to_favorites" />
+ </menu_item_call>
+ <menu_item_call
+ label="Remove from Favorites"
+ layout="topleft"
+ name="Remove from Favorites">
+ <menu_item_call.on_click
+ function="Inventory.DoToSelected"
+ parameter="remove_from_favorites" />
+ </menu_item_call>
+ <menu
+ label="Upload to folder"
+ layout="topleft"
+ name="upload_options">
+ <menu_item_call
+ label="Image..."
+ layout="topleft"
+ name="Upload Image">
+ <menu_item_call.on_click
+ function="Inventory.FileUploadLocation"
+ parameter="upload_texture" />
+ <menu_item_call.on_enable
+ function="File.EnableUpload" />
+ <menu_item_call.on_visible
+ function="Upload.CalculateCosts"
+ parameter="Upload Image,texture" />
+ </menu_item_call>
+ <menu_item_call
+ label="Sound (L$[COST])..."
+ layout="topleft"
+ name="Upload Sound">
+ <menu_item_call.on_click
+ function="Inventory.FileUploadLocation"
+ parameter="upload_sound" />
+ <menu_item_call.on_enable
+ function="File.EnableUpload" />
+ <menu_item_call.on_visible
+ function="Upload.CalculateCosts"
+ parameter="Upload Sound,sound" />
+ </menu_item_call>
+ <menu_item_call
+ label="Animation (L$[COST])..."
+ layout="topleft"
+ name="Upload Animation">
+ <menu_item_call.on_click
+ function="Inventory.FileUploadLocation"
+ parameter="upload_animation" />
+ <menu_item_call.on_enable
+ function="File.EnableUpload" />
+ <menu_item_call.on_visible
+ function="Upload.CalculateCosts"
+ parameter="Upload Animation,animation" />
+ </menu_item_call>
+ <menu_item_call
+ label="Model..."
+ layout="topleft"
+ name="Upload Model">
+ <menu_item_call.on_click
+ function="Inventory.FileUploadLocation"
+ parameter="upload_model" />
+ <menu_item_call.on_enable
+ function="File.EnableUploadModel" />
+ <menu_item_call.on_visible
+ function="File.VisibleUploadModel"/>
+ </menu_item_call>
+ <menu_item_call
+ label="Material..."
+ layout="topleft"
+ name="Upload Material">
+ <menu_item_call.on_click
+ function="Inventory.FileUploadLocation"
+ parameter="upload_pbr_material" />
+ <menu_item_call.on_enable
+ function="File.EnableUploadMaterial" />
+ </menu_item_call>
+ <menu_item_call
+ label="Bulk..."
+ layout="topleft"
+ name="Bulk Upload">
+ <menu_item_call.on_click
+ function="Inventory.FileUploadLocation"
+ parameter="upload_bulk" />
+ <menu_item_call.on_visible
+ function="Upload.CalculateCosts"
+ parameter="Bulk Upload,texture" />
+ </menu_item_call>
+ </menu>
<menu
label="Use as default for"
layout="topleft"
@@ -969,39 +1062,39 @@
name="Image uploads">
<menu_item_call.on_click
function="Inventory.FileUploadLocation"
- parameter="texture" />
+ parameter="def_texture" />
</menu_item_call>
<menu_item_call
label="Sound uploads"
layout="topleft"
name="Sound uploads">
- <menu_item_call.on_click
- function="Inventory.FileUploadLocation"
- parameter="sound" />
+ <menu_item_call.on_click
+ function="Inventory.FileUploadLocation"
+ parameter="def_sound" />
</menu_item_call>
<menu_item_call
label="Animation uploads"
layout="topleft"
name="Animation uploads">
- <menu_item_call.on_click
- function="Inventory.FileUploadLocation"
- parameter="animation" />
+ <menu_item_call.on_click
+ function="Inventory.FileUploadLocation"
+ parameter="def_animation" />
</menu_item_call>
<menu_item_call
label="Model uploads"
layout="topleft"
name="Model uploads">
- <menu_item_call.on_click
- function="Inventory.FileUploadLocation"
- parameter="model" />
+ <menu_item_call.on_click
+ function="Inventory.FileUploadLocation"
+ parameter="def_model" />
</menu_item_call>
<menu_item_call
label="PBR material uploads"
layout="topleft"
name="PBR uploads">
- <menu_item_call.on_click
- function="Inventory.FileUploadLocation"
- parameter="pbr_material" />
+ <menu_item_call.on_click
+ function="Inventory.FileUploadLocation"
+ parameter="def_pbr_material" />
</menu_item_call>
</menu>
<menu_item_call
diff --git a/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml b/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml
index e249acaccd..d17fbf84b3 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory_gear_default.xml
@@ -138,4 +138,15 @@
function="Inventory.GearDefault.Visible"
parameter="multi_folder_view" />
</menu_item_call>
+ <menu_item_separator/>
+ <menu_item_check
+ label="Inventory settings..."
+ name="inv_settings">
+ <menu_item_check.on_check
+ function="Floater.Visible"
+ parameter="inventory_settings" />
+ <menu_item_check.on_click
+ function="Floater.Toggle"
+ parameter="inventory_settings" />
+ </menu_item_check>
</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_inventory_view_default.xml b/indra/newview/skins/default/xui/en/menu_inventory_view_default.xml
index 33cf01493d..97f53d3a17 100644
--- a/indra/newview/skins/default/xui/en/menu_inventory_view_default.xml
+++ b/indra/newview/skins/default/xui/en/menu_inventory_view_default.xml
@@ -100,15 +100,4 @@
function="Inventory.GearDefault.Visible"
parameter="single_folder_view" />
</menu_item_check>
- <menu_item_separator/>
- <menu_item_check
- label="Inventory settings..."
- name="inv_settings">
- <menu_item_check.on_check
- function="Floater.Visible"
- parameter="inventory_settings" />
- <menu_item_check.on_click
- function="Floater.Toggle"
- parameter="inventory_settings" />
- </menu_item_check>
</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_outfit_gallery_sort.xml b/indra/newview/skins/default/xui/en/menu_outfit_gallery_sort.xml
new file mode 100644
index 0000000000..aa4cd1483d
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/menu_outfit_gallery_sort.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<toggleable_menu
+ layout="topleft"
+ visible="false"
+ name="Sort Outfit">
+ <menu_item_check
+ label="Sort favorites to top"
+ layout="topleft"
+ visible="true"
+ name="sort_favorites_to_top">
+ <on_click
+ function="Sort.OnSort"
+ parameter="favorites_to_top" />
+ <on_check
+ function="Sort.OnEnable"
+ parameter="favorites_to_top" />
+ </menu_item_check>
+ <menu_item_check
+ label="Sort images to top"
+ layout="topleft"
+ visible="true"
+ name="sort_images_to_top">
+ <on_click
+ function="Sort.OnSort"
+ parameter="images_to_top" />
+ <on_check
+ function="Sort.OnEnable"
+ parameter="images_to_top" />
+ </menu_item_check>
+ <menu_item_check
+ label="Sort by name"
+ layout="topleft"
+ visible="true"
+ name="sort_by_name">
+ <on_click
+ function="Sort.OnSort"
+ parameter="by_name" />
+ <on_check
+ function="Sort.OnEnable"
+ parameter="by_name" />
+ </menu_item_check>
+</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_outfit_gear.xml b/indra/newview/skins/default/xui/en/menu_outfit_gear.xml
index 8f36c7a00a..e333b05d3e 100644
--- a/indra/newview/skins/default/xui/en/menu_outfit_gear.xml
+++ b/indra/newview/skins/default/xui/en/menu_outfit_gear.xml
@@ -50,6 +50,26 @@
function="Gear.Thumbnail" />
</menu_item_call>
<menu_item_call
+ label="Add to favorite outfits"
+ layout="topleft"
+ name="favorites_add">
+ <on_visible
+ function="Gear.OnVisible"
+ parameter="favorites_add" />
+ <on_click
+ function="Gear.Favorite" />
+ </menu_item_call>
+ <menu_item_call
+ label="Remove from favorite outfits"
+ layout="topleft"
+ name="favorites_remove">
+ <on_visible
+ function="Gear.OnVisible"
+ parameter="favorites_remove" />
+ <on_click
+ function="Gear.Favorite" />
+ </menu_item_call>
+ <menu_item_call
label="Rename outfit"
layout="topleft"
name="rename">
@@ -89,34 +109,6 @@
function="Gear.OnVisible"
parameter="delete" />
</menu_item_call>
- <menu_item_separator>
- <on_visible
- function="Gear.OnVisible"/>
- </menu_item_separator>
- <menu_item_check
- label="Sort folders always by name"
- layout="topleft"
- name="sort_folders_by_name">
- <on_click
- function="Gear.SortByName" />
- <on_check
- function="CheckControl"
- parameter="OutfitGallerySortByName" />
- </menu_item_check>
- <menu_item_call
- label="Expand all folders"
- layout="topleft"
- name="expand">
- <on_click
- function="Gear.Expand" />
- </menu_item_call>
- <menu_item_call
- label="Collapse all folders"
- layout="topleft"
- name="collapse">
- <on_click
- function="Gear.Collapse" />
- </menu_item_call>
<menu_item_separator/>
<!-- copied (with minor modifications) from menu_inventory_add.xml -->
<!-- *TODO: generate dynamically? -->
@@ -277,4 +269,19 @@
</menu_item_call>
</menu>
<!-- copied from menu_inventory_add.xml -->
+
+ <menu_item_separator/>
+
+ <menu_item_check
+ label="Inventory settings..."
+ layout="topleft"
+ visible="true"
+ name="inventory_settings">
+ <menu_item_check.on_check
+ function="Floater.Visible"
+ parameter="inventory_settings" />
+ <menu_item_check.on_click
+ function="Floater.Toggle"
+ parameter="inventory_settings" />
+ </menu_item_check>
</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_outfit_list_sort.xml b/indra/newview/skins/default/xui/en/menu_outfit_list_sort.xml
new file mode 100644
index 0000000000..0a4d1ea877
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/menu_outfit_list_sort.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<toggleable_menu
+ layout="topleft"
+ visible="false"
+ name="Sort Outfit">
+ <menu_item_call
+ label="Expand all folders"
+ layout="topleft"
+ name="expand">
+ <on_click
+ function="Sort.Expand" />
+ </menu_item_call>
+ <menu_item_call
+ label="Collapse all folders"
+ layout="topleft"
+ visible="true"
+ name="collapse">
+ <on_click
+ function="Sort.Collapse" />
+ </menu_item_call>
+
+ <menu_item_separator/>
+
+ <menu_item_check
+ label="Sort favorites to top"
+ layout="topleft"
+ name="sort_favorites_to_top">
+ <on_click
+ function="Sort.OnSort"
+ parameter="favorites_to_top" />
+ <on_check
+ function="Sort.OnEnable"
+ parameter="favorites_to_top" />
+ </menu_item_check>
+
+ <menu_item_separator/>
+
+ <menu_item_check
+ label="Show entire outfit in search"
+ layout="topleft"
+ name="show_entire_outfit_in_search">
+ <on_click
+ function="Sort.OnSort"
+ parameter="show_entire_outfit" />
+ <on_check
+ function="Sort.OnEnable"
+ parameter="show_entire_outfit" />
+ </menu_item_check>
+</toggleable_menu>
diff --git a/indra/newview/skins/default/xui/en/menu_outfit_tab.xml b/indra/newview/skins/default/xui/en/menu_outfit_tab.xml
index c6805edd63..0d45e7c95c 100644
--- a/indra/newview/skins/default/xui/en/menu_outfit_tab.xml
+++ b/indra/newview/skins/default/xui/en/menu_outfit_tab.xml
@@ -50,6 +50,26 @@
function="Outfit.Thumbnail" />
</menu_item_call>
<menu_item_call
+ label="Add to favorites"
+ layout="topleft"
+ name="favorites_add">
+ <on_visible
+ function="Outfit.OnVisible"
+ parameter="favorites_add" />
+ <on_click
+ function="Outfit.Favorite" />
+ </menu_item_call>
+ <menu_item_call
+ label="Remove from favorites"
+ layout="topleft"
+ name="favorites_remove">
+ <on_visible
+ function="Outfit.OnVisible"
+ parameter="favorites_remove" />
+ <on_click
+ function="Outfit.Favorite" />
+ </menu_item_call>
+ <menu_item_call
label="Edit outfit"
layout="topleft"
name="edit">
diff --git a/indra/newview/skins/default/xui/en/menu_settings_gear.xml b/indra/newview/skins/default/xui/en/menu_settings_gear.xml
index 57f4aa8655..96cbac4478 100644
--- a/indra/newview/skins/default/xui/en/menu_settings_gear.xml
+++ b/indra/newview/skins/default/xui/en/menu_settings_gear.xml
@@ -24,6 +24,9 @@
<menu_item_call.on_click
function="MyEnvironments.DoApply"
parameter="local" />
+ <menu_item_call.on_enable
+ function="MyEnvironments.CanApply"
+ parameter="local"/>
</menu_item_call>
<menu_item_call
name="Settings Apply Parcel"
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 3de2473927..9bc65ac794 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -1586,6 +1586,64 @@ function="World.EnvPreset"
parameter="RenderDisablePostProcessing" />
</menu_item_check>
+
+ <menu
+ create_jump_keys="true"
+ label="Selection level of detail"
+ name="Selection level of detail"
+ tear_off="true">
+
+ <menu_item_check
+ label="Default"
+ name="Default lod setting">
+ <menu_item_check.on_check
+ function="Tools.ToolsCheckSelectionLODMode"
+ parameter="default" />
+ <menu_item_check.on_click
+ function="Tools.SelectionLODMode"
+ parameter="default" />
+ </menu_item_check>
+ <menu_item_check
+ label="High"
+ name="High lod setting">
+ <menu_item_check.on_check
+ function="Tools.ToolsCheckSelectionLODMode"
+ parameter="high" />
+ <menu_item_check.on_click
+ function="Tools.SelectionLODMode"
+ parameter="high" />
+ </menu_item_check>
+ <menu_item_check
+ label="Medium"
+ name="Medium lod setting">
+ <menu_item_check.on_check
+ function="Tools.ToolsCheckSelectionLODMode"
+ parameter="medium" />
+ <menu_item_check.on_click
+ function="Tools.SelectionLODMode"
+ parameter="medium" />
+ </menu_item_check>
+ <menu_item_check
+ label="Low"
+ name="Low lod setting">
+ <menu_item_check.on_check
+ function="Tools.ToolsCheckSelectionLODMode"
+ parameter="low" />
+ <menu_item_check.on_click
+ function="Tools.SelectionLODMode"
+ parameter="low" />
+ </menu_item_check>
+ <menu_item_check
+ label="Lowest"
+ name="Lowest lod setting">
+ <menu_item_check.on_check
+ function="Tools.ToolsCheckSelectionLODMode"
+ parameter="lowest" />
+ <menu_item_check.on_click
+ function="Tools.SelectionLODMode"
+ parameter="lowest" />
+ </menu_item_check>
+ </menu>
<menu_item_separator/>
<menu_item_check
diff --git a/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml b/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml
index ee77ef23f0..63d37edf38 100644
--- a/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml
+++ b/indra/newview/skins/default/xui/en/menu_wearable_list_item.xml
@@ -80,6 +80,20 @@
function="Attachment.Profile" />
</menu_item_call>
<menu_item_call
+ label="Add to favorites"
+ layout="topleft"
+ name="favorites_add">
+ <on_click
+ function="Attachment.Favorite" />
+ </menu_item_call>
+ <menu_item_call
+ label="Remove from favorites"
+ layout="topleft"
+ name="favorites_remove">
+ <on_click
+ function="Attachment.Favorite" />
+ </menu_item_call>
+ <menu_item_call
label="Show Original"
layout="topleft"
visible="false"
diff --git a/indra/newview/skins/default/xui/en/menu_wearing_tab.xml b/indra/newview/skins/default/xui/en/menu_wearing_tab.xml
index 321e8a0831..9a752a1643 100644
--- a/indra/newview/skins/default/xui/en/menu_wearing_tab.xml
+++ b/indra/newview/skins/default/xui/en/menu_wearing_tab.xml
@@ -31,6 +31,20 @@
function="Wearing.Detach"
parameter="detach"/>
</menu_item_call>
+ <menu_item_call
+ label="Add to favorites"
+ layout="topleft"
+ name="favorites_add">
+ <on_click
+ function="Wearing.Favorite" />
+ </menu_item_call>
+ <menu_item_call
+ label="Remove from favorites"
+ layout="topleft"
+ name="favorites_remove">
+ <on_click
+ function="Wearing.Favorite" />
+ </menu_item_call>
<menu_item_separator
layout="topleft"
name="edit_outfit_separator" />
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 4245b22e88..89511c2fa2 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -3139,9 +3139,13 @@ Would you be my friend?
<input name="listname" type="text"/>
<button
default="true"
- index="0"
+ index="1"
name="SetName"
text="OK"/>
+ <button
+ index="0"
+ name="Cancel"
+ text="Cancel"/>
</form>
</notification>
@@ -3170,6 +3174,29 @@ Would you be my friend?
<notification
icon="alertmodal.tga"
+ label="Rename Auto-Replace List"
+ name="RemoveAutoReplaceList"
+ type="alertmodal">
+'[LIST_NAME]' contains [MAP_SIZE] entries.
+
+Are you sure you want to delete this list?
+ <tag>confirm</tag>
+ <form name="form">
+ <button
+ default="true"
+ index="1"
+ name="DeleteList"
+ text="Delete"/>
+ <button
+ default="false"
+ index="0"
+ name="Cancel"
+ text="Cancel"/>
+ </form>
+ </notification>
+
+ <notification
+ icon="alertmodal.tga"
name="InvalidAutoReplaceEntry"
type="alertmodal">
The keyword must be a single word, and the replacement may not be empty.
@@ -4628,13 +4655,12 @@ You already have blocked this name.
<notification
icon="alert.tga"
- name="RemoveItemWarn"
+ name="CantModifyContentInNoModTask"
type="alert">
-Though permitted, deleting contents may damage the object. Do you want to delete that item?
+You don't have permission to modify content of this object
<tag>confirm</tag>
<usetemplate
- name="okcancelbuttons"
- notext="Cancel"
+ name="okbutton"
yestext="OK"/>
</notification>
@@ -10336,6 +10362,14 @@ You are now the owner of object [OBJECT_NAME]
<notification
icon="alertmodal.tga"
+ name="NowOwnObjectInv"
+ type="notify">
+ <tag>fail</tag>
+You are now the owner of object [OBJECT_NAME] and it has been placed in your inventory.
+ </notification>
+
+ <notification
+ icon="alertmodal.tga"
name="CantRezOnLand"
type="notify">
<tag>fail</tag>
diff --git a/indra/newview/skins/default/xui/en/panel_inventory_gallery_item.xml b/indra/newview/skins/default/xui/en/panel_inventory_gallery_item.xml
index 73cb9b080f..f5906c17fd 100644
--- a/indra/newview/skins/default/xui/en/panel_inventory_gallery_item.xml
+++ b/indra/newview/skins/default/xui/en/panel_inventory_gallery_item.xml
@@ -43,6 +43,16 @@
follows="left|top"
visible="false"
image_name="Inv_Link"/>
+ <icon
+ layout="topleft"
+ follows="left|top"
+ name="fav_icon"
+ left="110"
+ top_pad="-14"
+ height="14"
+ width="14"
+ visible="true"
+ image_name="Inv_Favorite_Star_Full"/>
<panel
background_visible="false"
background_opaque="true"
diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
index 498dab1ef3..6e1e6facbe 100644
--- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml
@@ -269,6 +269,22 @@
scroll.reserve_scroll_corner="false">
<folder double_click_override="true"/>
</inventory_panel>
+ <favorites_inventory_panel
+ bg_opaque_color="DkGray2"
+ bg_alpha_color="DkGray2"
+ background_visible="true"
+ border="false"
+ bevel_style="none"
+ follows="all"
+ label="FAVORITES"
+ help_topic="recent_inventory_tab"
+ layout="topleft"
+ name="Favorites"
+ show_item_link_overlays="true"
+ preinitialize_views="false"
+ scroll.reserve_scroll_corner="false">
+ <folder double_click_override="true"/>
+ </favorites_inventory_panel>
</tab_container>
</panel>
<panel
diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml
index a8a306bea9..9586957694 100644
--- a/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings_inventory.xml
@@ -21,5 +21,5 @@
border="false"
bevel_style="none"
show_item_link_overlays="true">
- <item allow_wear="false"/>
+ <item marketplace_item="true"/>
</inventory_panel>
diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings_listed.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings_listed.xml
index 0c665fb07e..5f64a5d47a 100644
--- a/indra/newview/skins/default/xui/en/panel_marketplace_listings_listed.xml
+++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings_listed.xml
@@ -20,5 +20,5 @@
border="false"
bevel_style="none"
show_item_link_overlays="true">
- <item allow_wear="false"/>
+ <item marketplace_item="true"/>
</inventory_panel>
diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings_unassociated.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings_unassociated.xml
index 0be405c5b8..ab4d836ba9 100644
--- a/indra/newview/skins/default/xui/en/panel_marketplace_listings_unassociated.xml
+++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings_unassociated.xml
@@ -19,5 +19,5 @@
border="false"
bevel_style="none"
show_item_link_overlays="true">
- <item allow_wear="false"/>
+ <item marketplace_item="true"/>
</inventory_panel>
diff --git a/indra/newview/skins/default/xui/en/panel_marketplace_listings_unlisted.xml b/indra/newview/skins/default/xui/en/panel_marketplace_listings_unlisted.xml
index 58122db7f4..303601e65b 100644
--- a/indra/newview/skins/default/xui/en/panel_marketplace_listings_unlisted.xml
+++ b/indra/newview/skins/default/xui/en/panel_marketplace_listings_unlisted.xml
@@ -20,5 +20,5 @@
border="false"
bevel_style="none"
show_item_link_overlays="true">
- <item allow_wear="false"/>
+ <item marketplace_item="true"/>
</inventory_panel>
diff --git a/indra/newview/skins/default/xui/en/panel_outfit_gallery.xml b/indra/newview/skins/default/xui/en/panel_outfit_gallery.xml
index 6166268206..d49bf19c5d 100644
--- a/indra/newview/skins/default/xui/en/panel_outfit_gallery.xml
+++ b/indra/newview/skins/default/xui/en/panel_outfit_gallery.xml
@@ -35,7 +35,7 @@
</text>
<scroll_container
follows="all"
- height="400"
+ height="429"
width="312"
layout="topleft"
left="4"
@@ -44,49 +44,5 @@
name="gallery_scroll_panel"
opaque="false"
top_pad="0">
- </scroll_container>
- <panel
- background_visible="false"
- follows="bottom|left|right"
- height="28"
- layout="topleft"
- left="4"
- top_pad="0"
- visible="true"
- name="bottom_panel"
- width="312">
- <menu_button
- follows="bottom|left"
- tool_tip="Show additional options"
- height="25"
- image_hover_unselected="Toolbar_Left_Over"
- image_overlay="OptionsMenu_Off"
- image_selected="Toolbar_Left_Selected"
- image_unselected="Toolbar_Left_Off"
- layout="topleft"
- left="0"
- name="options_gear_btn"
- top="1"
- width="31" />
- <icon
- follows="bottom|left|right"
- height="25"
- image_name="Toolbar_Middle_Off"
- layout="topleft"
- left_pad="1"
- name="dummy_icon"
- width="243"/>
- <button
- follows="bottom|right"
- height="25"
- image_hover_unselected="Toolbar_Right_Over"
- image_overlay="TrashItem_Off"
- image_selected="Toolbar_Right_Selected"
- image_unselected="Toolbar_Right_Off"
- layout="topleft"
- left_pad="1"
- name="trash_btn"
- tool_tip="Delete selected outfit"
- width="31"/>
- </panel>
+ </scroll_container>
</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_outfits_list.xml b/indra/newview/skins/default/xui/en/panel_outfits_list.xml
index e8d8e8f3e2..cd4e5ef1f6 100644
--- a/indra/newview/skins/default/xui/en/panel_outfits_list.xml
+++ b/indra/newview/skins/default/xui/en/panel_outfits_list.xml
@@ -16,7 +16,7 @@
bg_opaque_color="DkGray2"
follows="all"
- height="400"
+ height="428"
layout="topleft"
left="3"
name="outfits_accordion"
@@ -30,48 +30,4 @@
name="no_outfits_msg"
value="You don't have any outfits yet. Try [secondlife:///app/search/all/ Search]"/>
</accordion>
- <panel
- background_visible="false"
- follows="bottom|left|right"
- height="28"
- layout="topleft"
- left="4"
- top_pad="0"
- visible="true"
- name="bottom_panel"
- width="312">
- <menu_button
- follows="bottom|left"
- tool_tip="Show additional options"
- height="25"
- image_hover_unselected="Toolbar_Left_Over"
- image_overlay="OptionsMenu_Off"
- image_selected="Toolbar_Left_Selected"
- image_unselected="Toolbar_Left_Off"
- layout="topleft"
- left="0"
- name="options_gear_btn"
- top="1"
- width="31" />
- <icon
- follows="bottom|left|right"
- height="25"
- image_name="Toolbar_Middle_Off"
- layout="topleft"
- left_pad="1"
- name="dummy_icon"
- width="243"/>
- <button
- follows="bottom|right"
- height="25"
- image_hover_unselected="Toolbar_Right_Over"
- image_overlay="TrashItem_Off"
- image_selected="Toolbar_Right_Selected"
- image_unselected="Toolbar_Right_Off"
- layout="topleft"
- left_pad="1"
- name="trash_btn"
- tool_tip="Delete selected outfit"
- width="31"/>
- </panel>
</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_outfits_wearing.xml b/indra/newview/skins/default/xui/en/panel_outfits_wearing.xml
index 559917ec0a..10073f0461 100644
--- a/indra/newview/skins/default/xui/en/panel_outfits_wearing.xml
+++ b/indra/newview/skins/default/xui/en/panel_outfits_wearing.xml
@@ -16,7 +16,7 @@
<accordion
fit_parent="true"
follows="all"
- height="400"
+ height="429"
layout="topleft"
left="3"
single_expansion="true"
@@ -62,35 +62,4 @@
</scroll_list>
</accordion_tab>
</accordion>
- <panel
- background_visible="false"
- follows="bottom|left|right"
- height="28"
- layout="topleft"
- left="4"
- name="bottom_panel"
- top_pad="0"
- width="312">
- <menu_button
- follows="bottom|left"
- height="25"
- image_hover_unselected="Toolbar_Left_Over"
- image_overlay="OptionsMenu_Off"
- image_selected="Toolbar_Left_Selected"
- image_unselected="Toolbar_Left_Off"
- layout="topleft"
- left="0"
- name="options_gear_btn"
- tool_tip="Show additional options"
- top="1"
- width="31" />
- <icon
- follows="bottom|left|right"
- height="25"
- image_name="Toolbar_Right_Off"
- layout="topleft"
- left_pad="1"
- name="dummy_icon"
- width="274" />
- </panel>
</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_places.xml b/indra/newview/skins/default/xui/en/panel_places.xml
index 4d9a03823e..1005810145 100644
--- a/indra/newview/skins/default/xui/en/panel_places.xml
+++ b/indra/newview/skins/default/xui/en/panel_places.xml
@@ -19,7 +19,7 @@ background_visible="false"
value="VISITED" />
<string
name="favorites_tab_title"
- value="FAVORITES" />
+ value="FAVORITES BAR" />
<string
name="tooltip_trash_items"
value="Remove selected landmark or folder" />
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
index fa692d7200..9fba02d14e 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
@@ -347,6 +347,41 @@
0
</text>
+ <slider
+ control_name="IndirectMaxNonImpostors"
+ name="IndirectMaxNonImpostors"
+ decimal_digits="0"
+ increment="1"
+ initial_value="12"
+ show_text="false"
+ min_val="1"
+ max_val="66"
+ label="Maximum number of animated avatars:"
+ follows="left|top"
+ layout="topleft"
+ height="16"
+ label_width="240"
+ left="30"
+ top_delta="20"
+ width="393">
+ <slider.commit_callback
+ function="Pref.UpdateIndirectMaxNonImpostors"
+ parameter="IndirectNonImpostorsText" />
+ </slider>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ top_delta="0"
+ left_delta="397"
+ text_readonly_color="LabelDisabledColor"
+ name="IndirectMaxNonImpostorsText"
+ width="65">
+ 0
+ </text>
+
<button
height="23"
label="Exceptions..."
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_move.xml b/indra/newview/skins/default/xui/en/panel_preferences_move.xml
index 8202bb9de3..395efe3169 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_move.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_move.xml
@@ -113,7 +113,7 @@
control_name="ArrowKeysAlwaysMove"
follows="left|top"
height="20"
- label="Arrow keys always move me"
+ label="Arrow keys always move me while in chat"
layout="topleft"
left_delta="5"
name="arrow_keys_move_avatar_check"
diff --git a/indra/newview/skins/default/xui/en/panel_settings_sky_clouds.xml b/indra/newview/skins/default/xui/en/panel_settings_sky_clouds.xml
index 7687f7cd96..23bbf45e88 100644
--- a/indra/newview/skins/default/xui/en/panel_settings_sky_clouds.xml
+++ b/indra/newview/skins/default/xui/en/panel_settings_sky_clouds.xml
@@ -139,7 +139,7 @@
max_val_x="30"
min_val_y="-30"
max_val_y="30"
- logarithmic="1"/>
+ logarithmic="true"/>
<text
name="cloud_image_label"
diff --git a/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml b/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml
index bd68434aab..34b48574d5 100644
--- a/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml
+++ b/indra/newview/skins/default/xui/en/panel_settings_sky_sunmoon.xml
@@ -248,29 +248,13 @@
</layout_panel>
<layout_panel
- name="moon_layout"
- border="false"
+ border="true"
bevel_style="in"
+ name="moon_layout"
auto_resize="true"
user_resize="false"
visible="true"
height="400">
- <layout_stack
- name="moon_stack"
- left="5"
- top="5"
- right="-5"
- bottom="-5"
- follows="left|top|right|bottom"
- orientation="vertical">
- <layout_panel
- border="true"
- bevel_style="in"
- auto_resize="true"
- user_resize="false"
- visible="true"
- name="moon_layout"
- height="220">
<text
name="moon_label"
follows="left|top"
@@ -423,9 +407,7 @@
name="moonbeacon"
top_pad="5"
left_delta="-8"/>
-
- </layout_panel>
- </layout_stack>
+
</layout_panel>
</layout_stack>
</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_settings_water.xml b/indra/newview/skins/default/xui/en/panel_settings_water.xml
index 5e65b0e8a2..36ec0cb3ea 100644
--- a/indra/newview/skins/default/xui/en/panel_settings_water.xml
+++ b/indra/newview/skins/default/xui/en/panel_settings_water.xml
@@ -247,7 +247,7 @@
Reflection Wavelet Scale
</text>
<slider
- decimal_digits="1"
+ decimal_digits="2"
follows="left|top"
increment="0.01"
height="16"
@@ -261,7 +261,7 @@
width="150"
can_edit_text="true"/>
<slider
- decimal_digits="1"
+ decimal_digits="2"
follows="left|top"
increment="0.01"
initial_value="0.7"
@@ -274,7 +274,7 @@
width="150"
can_edit_text="true"/>
<slider
- decimal_digits="1"
+ decimal_digits="2"
follows="left|top"
increment="0.01"
initial_value="0.7"
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
index f8040b9a65..0cac1b410f 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml
@@ -60,7 +60,7 @@
name="Large(512x512)"
value="[i512,i512]" />
<combo_box.item
- label="Current Window(512x512)"
+ label="Current Window"
name="CurrentWindow"
value="[i0,i0]" />
<combo_box.item
@@ -119,6 +119,8 @@
type="string"
word_wrap="true">
To save your image as a texture select one of the square formats.
+
+Upload cost: L$[UPLOAD_COST]
</text>
<button
follows="right|bottom"
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml
index 3a7731d235..2fb02af61c 100644
--- a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml
@@ -31,7 +31,7 @@
image_overlay_alignment="left"
image_top_pad="-1"
imgoverlay_label_space="10"
- label="Save to Inventory (L$[AMOUNT])"
+ label="Save to Inventory"
layout="topleft"
left_delta="0"
name="save_to_inventory_btn"
diff --git a/indra/newview/skins/default/xui/en/sidepanel_appearance.xml b/indra/newview/skins/default/xui/en/sidepanel_appearance.xml
index c03fac4aad..3e9efb6f8b 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_appearance.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_appearance.xml
@@ -64,7 +64,7 @@ width="333">
font="SansSerifSmall"
text_color="EmphasisColor"
width="300"
- height="10"
+ height="13"
follows="top|left|right"
layout="topleft"
left="35"
@@ -94,7 +94,7 @@ width="333">
image_overlay="Edit_Wrench"
label=""
layout="topleft"
- left="265"
+ right="-3"
name="edit_outfit_btn"
tool_tip="Edit this outfit"
top="3"
@@ -108,17 +108,100 @@ width="333">
top="6"
width="24" />
</panel>
- <filter_editor
- height="23"
- follows="left|top|right"
- layout="topleft"
- left="10"
- label="Filter Outfits"
- max_length_chars="300"
- name="Filter"
- search_button_visible="true"
- top_pad="10"
- width="307" />
+ <layout_stack
+ animate="false"
+ border_size="0"
+ follows="left|top|right"
+ height="27"
+ layout="topleft"
+ orientation="horizontal"
+ top_pad="6"
+ left="0"
+ name="top_menu_panel"
+ width="320">
+ <layout_panel
+ auto_resize="true"
+ layout="topleft"
+ name="filter_panel"
+ width="193">
+ <filter_editor
+ text_pad_left="10"
+ follows="left|top|right"
+ font="SansSerifSmall"
+ height="23"
+ layout="topleft"
+ left="10"
+ label="Filter Outfits"
+ max_length_chars="300"
+ name="Filter"
+ search_button_visible="true"
+ tab_group="1"
+ top="3"
+ width="181" />
+ </layout_panel>
+ <layout_panel
+ auto_resize="false"
+ height="25"
+ layout="topleft"
+ name="options_gear_btn_panel"
+ width="32">
+ <menu_button
+ follows="bottom|left"
+ tool_tip="Show additional options"
+ height="25"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_overlay="OptionsMenu_Off"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ menu_position="bottomleft"
+ layout="topleft"
+ left="0"
+ name="options_gear_btn"
+ top="0"
+ width="31" />
+ </layout_panel>
+ <layout_panel
+ auto_resize="false"
+ height="25"
+ layout="topleft"
+ name="options_sort_btn_panel"
+ width="32">
+ <menu_button
+ follows="bottom|left"
+ tool_tip="Show sorting options"
+ height="25"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_overlay="Conv_toolbar_sort"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ menu_position="bottomleft"
+ layout="topleft"
+ left="0"
+ name="sorting_menu_btn"
+ top="0"
+ width="31" />
+ </layout_panel>
+ <layout_panel
+ auto_resize="false"
+ height="25"
+ layout="topleft"
+ name="trash_btn_panel"
+ width="31">
+ <dnd_button
+ follows="bottom|left"
+ height="25"
+ image_hover_unselected="Toolbar_Right_Over"
+ image_overlay="TrashItem_Off"
+ image_selected="Toolbar_Right_Selected"
+ image_unselected="Toolbar_Right_Off"
+ left="0"
+ layout="topleft"
+ name="trash_btn"
+ tool_tip="Delete selected outfit"
+ top="0"
+ width="31"/>
+ </layout_panel>
+ </layout_stack>
<panel
class="panel_outfits_inventory"
filename="panel_outfits_inventory.xml"
@@ -129,7 +212,7 @@ width="333">
visible="false"
left="0"
tab_group="1"
- top_pad="6"
+ top_pad="4"
follows="all" />
<panel
class="panel_outfit_edit"
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 44da9a8dac..bd8593bf75 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -71,7 +71,7 @@ Voice Server Version: [VOICE_VERSION]
<string name="LocalTime">[month, datetime, local] [day, datetime, local] [year, datetime, local] [hour, datetime, local]:[min, datetime, local]:[second,datetime, local]</string>
<string name="ErrorFetchingServerReleaseNotesURL">Error fetching server release notes URL.</string>
<string name="BuildConfiguration">Build Configuration</string>
-
+
<!-- progress -->
<string name="ProgressRestoring">Restoring...</string>
<string name="ProgressChangingResolution">Changing resolution...</string>
@@ -114,10 +114,10 @@ Voice Server Version: [VOICE_VERSION]
<string name="LoginFailedHeader">Login failed.</string>
<string name="Quit">Quit</string>
<string name="create_account_url">http://join.secondlife.com/?sourceid=[sourceid]</string>
-
+
<string name="AgniGridLabel">Second Life Main Grid (Agni)</string>
<string name="AditiGridLabel">Second Life Beta Test Grid (Aditi)</string>
-
+
<string name="ViewerDownloadURL">http://secondlife.com/download</string>
<string name="LoginFailedViewerNotPermitted">
The viewer you are using can no longer access Second Life. Please visit the following page to download a new viewer:
@@ -209,7 +209,7 @@ If you feel this is an error, please contact support@secondlife.com</string>
<string name="YouHaveBeenDisconnected">You have been disconnected from the region you were in.</string>
<string name="SentToInvalidRegion">You were sent to an invalid region.</string>
<string name="TestingDisconnect">Testing viewer disconnect</string>
-
+
<!-- SLShare: User Friendly Filter Names Translation -->
<string name="BlackAndWhite">Black &amp; White</string>
<string name="Colors1970">1970&apos;s Colors</string>
@@ -222,7 +222,7 @@ If you feel this is an error, please contact support@secondlife.com</string>
<string name="LensFlare">Lens Flare</string>
<string name="Miniature">Miniature</string>
<string name="Toycamera">Toy Camera</string>
-
+
<!-- Tooltip -->
<string name="TooltipPerson">Person</string><!-- Object under mouse pointer is an avatar -->
<string name="TooltipNoName">(no name)</string> <!-- No name on an object -->
@@ -259,10 +259,10 @@ If you feel this is an error, please contact support@secondlife.com</string>
<string name="TooltipOutboxMixedStock">All items in a stock folder must have the same type and permission</string>
<string name="TooltipOutfitNotInInventory">You can only put items or outfits from your personal inventory into "My outfits"</string>
<string name="TooltipCantCreateOutfit">One or more items can't be used inside "My outfits"</string>
-
+
<string name="TooltipDragOntoOwnChild">You can't move a folder into its child</string>
<string name="TooltipDragOntoSelf">You can't move a folder into itself</string>
-
+
<!-- tooltips for Urls -->
<string name="TooltipHttpUrl">Click to view this web page</string>
<string name="TooltipSLURL">Click to view this location's information</string>
@@ -370,7 +370,7 @@ are allowed.
<string name="AssetUploadServerDifficulties">The server is experiencing unexpected difficulties.</string>
<string name="AssetUploadServerUnavaliable">Service not available or upload timeout was reached.</string>
<string name="AssetUploadRequestInvalid">
-Error in upload request. Please visit
+Error in upload request. Please visit
http://secondlife.com/support for help fixing this problem.
</string>
@@ -534,7 +534,7 @@ http://secondlife.com/support for help fixing this problem.
<string name="ChangeYourDefaultAnimations">Change your default animations</string>
<string name="ForceSitAvatar">Force your avatar to sit</string>
<string name="ChangeEnvSettings">Change your environment settings</string>
-
+
<string name="NotConnected">Not Connected</string>
<string name="AgentNameSubst">(You)</string> <!-- Substitution for agent name -->
<string name="JoinAnExperience"/><!-- intentionally blank -->
@@ -2320,7 +2320,8 @@ For AI Character: Get the closest navigable point to the point provided.
<!-- inventory -->
<string name="InventoryNoMatchingItems">Didn't find what you're looking for? Try [secondlife:///app/search/all/[SEARCH_TERM] Search].</string>
- <string name="InventoryNoMatchingRecentItems">Didn't find what you're looking for? Try [secondlife:///app/inventory/filters Show filters].</string>
+ <string name="InventoryNoMatchingRecentItems">Didn't find what you're looking for? Try [secondlife:///app/inventory/filters Show filters].</string>
+ <string name="InventoryNoMatchingFavorites">You haven't marked any items as favorites.</string>
<string name="PlacesNoMatchingItems">To add a place to your landmarks, click the star to the right of the location name.</string>
<string name="FavoritesNoMatchingItems">To add a place to your favorites, click the star to the right of the location name, then save the landmark to "Favorites bar".</string>
<string name="MarketplaceNoListing">You have no listings yet.</string>
@@ -2484,13 +2485,13 @@ If you continue to receive this message, please contact Second Life support for
<string name="InvFolder Uncompressed Sounds">Uncompressed Sounds</string>
<string name="InvFolder Animations">Animations</string>
<string name="InvFolder Gestures">Gestures</string>
- <string name="InvFolder Favorite">My Favorites</string>
+ <string name="InvFolder Favorite">Favorites Bar</string>
<!-- historically default name of the Favorites folder can start from either "f" or "F" letter.
Also, it can be written as "Favorite" or "Favorites".
We should localize all variants of them with the same value -->
- <string name="InvFolder favorite">My Favorites</string>
- <string name="InvFolder Favorites">My Favorites</string>
- <string name="InvFolder favorites">My Favorites</string>
+ <string name="InvFolder favorite">Favorites Bar</string>
+ <string name="InvFolder Favorites">Favorites Bar</string>
+ <string name="InvFolder favorites">Favorites Bar</string>
<string name="InvFolder Current Outfit">Current Outfit</string>
<string name="InvFolder Initial Outfits">Initial Outfits</string>
<string name="InvFolder My Outfits">My Outfits</string>
@@ -2503,7 +2504,7 @@ If you continue to receive this message, please contact Second Life support for
<string name="InvFolder Materials">Materials</string>
<!-- are used for Friends and Friends/All folders in Inventory "Calling cards" folder. See EXT-694-->
- <string name="InvFolder Friends">Friends</string>
+ <string name="InvFolder Friends">Friends</string>
<string name="InvFolder All">All</string>
<string name="no_attachments">No attachments worn</string>
@@ -2672,7 +2673,7 @@ If you continue to receive this message, please contact Second Life support for
<string name="UploadFailed">File upload failed: </string>
<string name="ObjectOutOfRange">Script (object out of range)</string>
<string name="ScriptWasDeleted">Script (deleted from inventory)</string>
-
+
<!-- god tools -->
<string name="GodToolsObjectOwnedBy">Object [OBJECT] owned by [OWNER]</string>
@@ -2942,14 +2943,12 @@ Expected .wav, .tga, .bmp, .jpg, .jpeg, or .anim
<string name="Linden Location">Linden Location</string>
<string name="Adult">Adult</string>
<string name="Arts&amp;Culture">Arts &amp; Culture</string>
- <string name="Arts and Culture">Arts &amp; Culture</string>
<string name="Business">Business</string>
<string name="Educational">Educational</string>
<string name="Gaming">Gaming</string>
<string name="Hangout">Hangout</string>
<string name="Newcomer Friendly">Newcomer Friendly</string>
<string name="Parks&amp;Nature">Parks &amp; Nature</string>
- <string name="Parks and Nature">Parks &amp; Nature</string>
<string name="Residential">Residential</string>
<!--<string name="Shopping">Shopping</string> -->
<string name="Stage">Stage</string>
@@ -3719,6 +3718,10 @@ Please reinstall viewer from https://secondlife.com/support/downloads/ and cont
<string name="inventory_folder_offered-im">
Inventory folder '[ITEM_NAME]' offered
</string>
+ <string name="bot_warning">
+ You are chatting with a bot, [NAME]. Do not share any personal information.
+Learn more at https://second.life/scripted-agents.
+ </string>
<string name="share_alert">
Drag items from inventory here
</string>
@@ -3851,7 +3854,7 @@ Please reinstall viewer from https://secondlife.com/support/downloads/ and cont
<string name="uploading_costs">Uploading costs L$ [AMOUNT]</string>
<string name="this_costs">This costs L$ [AMOUNT]</string>
-
+
<string name="buying_selected_land">This land costs</string>
<string name="this_object_costs">This item costs</string>
<string name="giving">You want to give</string>
@@ -3932,7 +3935,7 @@ Abuse Report</string>
<string name="New Daycycle">New Daycycle</string>
<string name="New Water">New Water</string>
<string name="New Sky">New Sky</string>
-
+
<string name="/bow">/bow</string>
<string name="/clap">/clap</string>
@@ -4014,7 +4017,7 @@ Please check http://status.secondlifegrid.net to see if there is a known problem
<string name="Accounting">Accounting</string>
<string name="Notices">Notices</string>
<string name="Chat">Chat</string>
-
+
<!-- SL Membership -->
<string name="BaseMembership">Base</string>
<string name="PremiumMembership">Premium</string>
@@ -4180,7 +4183,7 @@ Try enclosing path to the editor with double quotes.
<!-- commands -->
- <string
+ <string
name="Command_360_Capture_Label">360 snapshot</string>
<string name="Command_AboutLand_Label">About land</string>
<string name="Command_Appearance_Label">Outfits</string>
@@ -4213,9 +4216,9 @@ name="Command_360_Capture_Label">360 snapshot</string>
<string name="Command_View_Label">Camera controls</string>
<string name="Command_Voice_Label">Voice settings</string>
<string name="Command_FavoriteFolder_Label">Favorite folder</string>
- <string name="Command_ResyncAnimations_Label">Resync animations</string>
+ <string name="Command_ResyncAnimations_Label">Resync animations</string>
- <string
+ <string
name="Command_360_Capture_Tooltip">Capture a 360 equirectangular image</string>
<string name="Command_AboutLand_Tooltip">Information about the land you're visiting</string>
<string name="Command_Appearance_Tooltip">Change your avatar</string>
@@ -4248,7 +4251,7 @@ name="Command_360_Capture_Tooltip">Capture a 360 equirectangular image</string>
<string name="Command_View_Tooltip">Changing camera angle</string>
<string name="Command_Voice_Tooltip">Volume controls for calls and people near you in world</string>
<string name="Command_FavoriteFolder_Tooltip">Open your favorite inventory folder</string>
- <string name="Command_ResyncAnimations_Tooltip">Synchronizes avatar animations</string>
+ <string name="Command_ResyncAnimations_Tooltip">Synchronizes avatar animations</string>
<string name="Toolbar_Bottom_Tooltip">currently in your bottom toolbar</string>
<string name="Toolbar_Left_Tooltip" >currently in your left toolbar</string>
@@ -4282,7 +4285,7 @@ name="Command_360_Capture_Tooltip">Capture a 360 equirectangular image</string>
<!-- Spell check settings floater -->
<string name="UserDictionary">[User]</string>
-
+
<!-- Experience Tools strings -->
<string name="experience_tools_experience">Experience</string>
<string name="ExperienceNameNull">(no experience)</string>
@@ -4344,7 +4347,7 @@ name="Command_360_Capture_Tooltip">Capture a 360 equirectangular image</string>
<string name="Default">Default</string>
<string name="none_paren_cap">(None)</string>
<string name="no_limit">No limit</string>
-
+
<string name="Mav_Details_MAV_FOUND_DEGENERATE_TRIANGLES">
The physics shape contains triangles which are too small. Try simplifying the physics model.
</string>
diff --git a/indra/newview/skins/default/xui/en/widgets/folder_view_item.xml b/indra/newview/skins/default/xui/en/widgets/folder_view_item.xml
index b598bbccd8..50c5285e04 100644
--- a/indra/newview/skins/default/xui/en/widgets/folder_view_item.xml
+++ b/indra/newview/skins/default/xui/en/widgets/folder_view_item.xml
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<folder_view_item
folder_arrow_image="Folder_Arrow"
+ favorite_image="Inv_Favorite_Star_Full"
+ favorite_content_image="Inv_Favorite_Star_Content"
folder_indentation="8"
item_height="20"
item_top_pad="4"
diff --git a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml
index 27ec6ded81..865c145022 100644
--- a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml
+++ b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<inbox_folder_view_folder
folder_arrow_image="Folder_Arrow"
+ favorite_image="Inv_Favorite_Star_Full"
+ favorite_content_image="Inv_Favorite_Star_Content"
folder_indentation="8"
item_height="20"
item_top_pad="4"
diff --git a/indra/newview/skins/default/xui/en/widgets/sun_moon_trackball.xml b/indra/newview/skins/default/xui/en/widgets/sun_moon_trackball.xml
index cdeff6ab05..f246ff764a 100644
--- a/indra/newview/skins/default/xui/en/widgets/sun_moon_trackball.xml
+++ b/indra/newview/skins/default/xui/en/widgets/sun_moon_trackball.xml
@@ -3,7 +3,6 @@
name="virtualtrackball"
width="150"
height="150"
- user_resize="false"
increment_angle_mouse="1.5f"
increment_angle_btn="1.0f"
image_sphere="VirtualTrackball_Sphere"
diff --git a/indra/newview/skins/default/xui/en/widgets/xy_vector.xml b/indra/newview/skins/default/xui/en/widgets/xy_vector.xml
index 23cde55f30..923895be5e 100644
--- a/indra/newview/skins/default/xui/en/widgets/xy_vector.xml
+++ b/indra/newview/skins/default/xui/en/widgets/xy_vector.xml
@@ -3,11 +3,9 @@
name="xyvector"
width="120"
height="140"
- decimal_digits="1"
label_width="16"
padding="4"
- edit_bar_height="18"
- user_resize="false">
+ edit_bar_height="18">
<xy_vector.border
visible="true"/>
diff --git a/indra/newview/skins/default/xui/es/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/es/panel_snapshot_inventory.xml
index b5cf57ade7..c9eea9a58e 100644
--- a/indra/newview/skins/default/xui/es/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/es/panel_snapshot_inventory.xml
@@ -7,7 +7,7 @@
Guardar una imagen en el inventario cuesta [UPLOAD_COST] L$. Para guardar una imagen como una textura, selecciona uno de los formatos cuadrados.
</text>
<combo_box label="Resolución" name="texture_size_combo">
- <combo_box.item label="Ventana actual (512 × 512)" name="CurrentWindow"/>
+ <combo_box.item label="Ventana actual" name="CurrentWindow"/>
<combo_box.item label="Pequeña (128x128)" name="Small(128x128)"/>
<combo_box.item label="Mediana (256x256)" name="Medium(256x256)"/>
<combo_box.item label="Grande (512x512)" name="Large(512x512)"/>
diff --git a/indra/newview/skins/default/xui/es/panel_snapshot_options.xml b/indra/newview/skins/default/xui/es/panel_snapshot_options.xml
index 4eb9ecf28f..f3119c739e 100644
--- a/indra/newview/skins/default/xui/es/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/es/panel_snapshot_options.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="panel_snapshot_options">
<button label="Guardar en disco" name="save_to_computer_btn"/>
- <button label="Guardar en inventario (L$[AMOUNT])" name="save_to_inventory_btn"/>
+ <button label="Guardar en inventario" name="save_to_inventory_btn"/>
<button label="Compartir en los comentarios de Mi perfil" name="save_to_profile_btn"/>
<button label="Compartir en Facebook" name="send_to_facebook_btn"/>
<button label="Compartir en Twitter" name="send_to_twitter_btn"/>
diff --git a/indra/newview/skins/default/xui/es/strings.xml b/indra/newview/skins/default/xui/es/strings.xml
index cf86427477..8515108943 100644
--- a/indra/newview/skins/default/xui/es/strings.xml
+++ b/indra/newview/skins/default/xui/es/strings.xml
@@ -1584,6 +1584,10 @@ Si sigues recibiendo este mensaje, contacta con [SUPPORT_SITE].</string>
<string name="conference-title-incoming">Conferencia con [AGENT_NAME]</string>
<string name="inventory_item_offered-im">Ítem del inventario '[ITEM_NAME]' ofrecido</string>
<string name="inventory_folder_offered-im">Carpeta del inventario '[ITEM_NAME]' ofrecida</string>
+ <string name="bot_warning">
+Estás conversando con un bot, [NAME]. No compartas información personal.
+Más información en https://second.life/scripted-agents.
+ </string>
<string name="share_alert">Arrastra los ítems desde el invenbtario hasta aquí</string>
<string name="facebook_post_success">Has publicado en Facebook.</string>
<string name="flickr_post_success">Has publicado en Flickr.</string>
diff --git a/indra/newview/skins/default/xui/fr/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/fr/panel_snapshot_inventory.xml
index 3cf64583d2..a560ff8d5e 100644
--- a/indra/newview/skins/default/xui/fr/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/fr/panel_snapshot_inventory.xml
@@ -7,7 +7,7 @@
L&apos;enregistrement d&apos;une image dans l&apos;inventaire coûte [UPLOAD_COST] L$. Pour enregistrer votre image sous forme de texture, sélectionnez un format carré.
</text>
<combo_box label="Résolution" name="texture_size_combo">
- <combo_box.item label="Fenêtre actuelle (512x512)" name="CurrentWindow"/>
+ <combo_box.item label="Fenêtre actuelle" name="CurrentWindow"/>
<combo_box.item label="Petite (128 x 128)" name="Small(128x128)"/>
<combo_box.item label="Moyenne (256 x 256)" name="Medium(256x256)"/>
<combo_box.item label="Grande (512 x 512)" name="Large(512x512)"/>
diff --git a/indra/newview/skins/default/xui/fr/panel_snapshot_options.xml b/indra/newview/skins/default/xui/fr/panel_snapshot_options.xml
index bdedb9162f..52fa318f8e 100644
--- a/indra/newview/skins/default/xui/fr/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/fr/panel_snapshot_options.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="panel_snapshot_options">
<button label="Enreg. sur le disque" name="save_to_computer_btn"/>
- <button label="Enreg. dans l&apos;inventaire ([AMOUNT] L$)" name="save_to_inventory_btn"/>
+ <button label="Enreg. dans l&apos;inventaire" name="save_to_inventory_btn"/>
<button label="Partager sur le flux de profil" name="save_to_profile_btn"/>
<button label="Partager sur Facebook" name="send_to_facebook_btn"/>
<button label="Partager sur Twitter" name="send_to_twitter_btn"/>
diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml
index 3889e26aee..c0f990d86b 100644
--- a/indra/newview/skins/default/xui/fr/strings.xml
+++ b/indra/newview/skins/default/xui/fr/strings.xml
@@ -1614,6 +1614,10 @@ Si ce message persiste, veuillez aller sur la page [SUPPORT_SITE].</string>
<string name="conference-title-incoming">Conférence avec [AGENT_NAME]</string>
<string name="inventory_item_offered-im">Objet de l’inventaire [ITEM_NAME] offert</string>
<string name="inventory_folder_offered-im">Dossier de l’inventaire [ITEM_NAME] offert</string>
+ <string name="bot_warning">
+Vous discutez avec un bot, [NAME]. Ne partagez pas d’informations personnelles.
+En savoir plus sur https://second.life/scripted-agents.
+ </string>
<string name="share_alert">Faire glisser les objets de l'inventaire ici</string>
<string name="facebook_post_success">Vous avez publié sur Facebook.</string>
<string name="flickr_post_success">Vous avez publié sur Flickr.</string>
diff --git a/indra/newview/skins/default/xui/it/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/it/panel_snapshot_inventory.xml
index 75b5d64660..21b65e8e69 100644
--- a/indra/newview/skins/default/xui/it/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/it/panel_snapshot_inventory.xml
@@ -7,7 +7,7 @@
Salvare un&apos;immagine nell&apos;inventario costa L$[UPLOAD_COST]. Per salvare l&apos;immagine come texture, selezionare uno dei formati quadrati.
</text>
<combo_box label="Risoluzione" name="texture_size_combo">
- <combo_box.item label="Finestra corrente (512x512)" name="CurrentWindow"/>
+ <combo_box.item label="Finestra corrente" name="CurrentWindow"/>
<combo_box.item label="Piccola (128x128)" name="Small(128x128)"/>
<combo_box.item label="Media (256x256)" name="Medium(256x256)"/>
<combo_box.item label="Grande (512x512)" name="Large(512x512)"/>
diff --git a/indra/newview/skins/default/xui/it/panel_snapshot_options.xml b/indra/newview/skins/default/xui/it/panel_snapshot_options.xml
index 50fb3d39fa..7fce171326 100644
--- a/indra/newview/skins/default/xui/it/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/it/panel_snapshot_options.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="panel_snapshot_options">
<button label="Salva sul disco" name="save_to_computer_btn"/>
- <button label="Salva nell&apos;inventario (L$[AMOUNT])" name="save_to_inventory_btn"/>
+ <button label="Salva nell&apos;inventario" name="save_to_inventory_btn"/>
<button label="Condividi sul feed del profilo" name="save_to_profile_btn"/>
<button label="Condividi su Facebook" name="send_to_facebook_btn"/>
<button label="Condividi su Twitter" name="send_to_twitter_btn"/>
diff --git a/indra/newview/skins/default/xui/it/strings.xml b/indra/newview/skins/default/xui/it/strings.xml
index 270e7ac3a1..4bd1285f2d 100644
--- a/indra/newview/skins/default/xui/it/strings.xml
+++ b/indra/newview/skins/default/xui/it/strings.xml
@@ -1586,6 +1586,10 @@ Se il messaggio persiste, contatta [SUPPORT_SITE].</string>
<string name="conference-title-incoming">Chiamata in conferenza con [AGENT_NAME]</string>
<string name="inventory_item_offered-im">Offerto oggetto di inventario &quot;[ITEM_NAME]&quot;</string>
<string name="inventory_folder_offered-im">Offerta cartella di inventario &quot;[ITEM_NAME]&quot;</string>
+ <string name="bot_warning">
+Stai parlando con un bot, [NAME]. Non condividere informazioni personali.
+Scopri di più su https://second.life/scripted-agents.
+ </string>
<string name="facebook_post_success">Hai pubblicato su Facebook.</string>
<string name="flickr_post_success">Hai pubblicato su Flickr.</string>
<string name="twitter_post_success">Hai pubblicato su Twitter.</string>
diff --git a/indra/newview/skins/default/xui/ja/panel_settings_sky_sunmoon.xml b/indra/newview/skins/default/xui/ja/panel_settings_sky_sunmoon.xml
index f8837c40a7..844a556af1 100644
--- a/indra/newview/skins/default/xui/ja/panel_settings_sky_sunmoon.xml
+++ b/indra/newview/skins/default/xui/ja/panel_settings_sky_sunmoon.xml
@@ -44,8 +44,6 @@
<check_box label="ビーコンを表示" name="sunbeacon"/>
</layout_panel>
<layout_panel name="moon_layout">
- <layout_stack name="moon_stack">
- <layout_panel name="moon_layout">
<text name="moon_label">
</text>
@@ -74,8 +72,6 @@
</text>
<slider name="moon_brightness"/>
<check_box label="ビーコンを表示" name="moonbeacon"/>
- </layout_panel>
- </layout_stack>
</layout_panel>
</layout_stack>
</panel>
diff --git a/indra/newview/skins/default/xui/ja/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/ja/panel_snapshot_inventory.xml
index c55c11e928..04ecba4264 100644
--- a/indra/newview/skins/default/xui/ja/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/ja/panel_snapshot_inventory.xml
@@ -6,7 +6,7 @@
</text>
<view_border name="hr"/>
<combo_box label="解像度" name="texture_size_combo">
- <combo_box.item label="現在のウィンドウ (512✕512)" name="CurrentWindow"/>
+ <combo_box.item label="現在のウィンドウ" name="CurrentWindow"/>
<combo_box.item label="小(128✕128)" name="Small(128x128)"/>
<combo_box.item label="中(256✕256)" name="Medium(256x256)"/>
<combo_box.item label="大(512✕512)" name="Large(512x512)"/>
@@ -16,7 +16,7 @@
<spinner label="" name="inventory_snapshot_height"/>
<check_box label="縦横比の固定" name="inventory_keep_aspect_check"/>
<text name="hint_lbl">
- 画像をテクスチャとして保存する場合は、いずれかの正方形を選択してください。
+ 画像をインベントリに保存するには L$[UPLOAD_COST] の費用がかかります。画像をテクスチャとして保存するには平方形式の 1 つを選択してください。
</text>
<button label="キャンセル" name="cancel_btn"/>
<button label="保存" name="save_btn"/>
diff --git a/indra/newview/skins/default/xui/ja/panel_snapshot_options.xml b/indra/newview/skins/default/xui/ja/panel_snapshot_options.xml
index 7a1aa280ec..a979e31c9a 100644
--- a/indra/newview/skins/default/xui/ja/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/ja/panel_snapshot_options.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="panel_snapshot_options">
<button label="ディスクに保存" name="save_to_computer_btn"/>
- <button label="インベントリに保存(L$ [AMOUNT])" name="save_to_inventory_btn"/>
+ <button label="インベントリに保存" name="save_to_inventory_btn"/>
<button label="プロフィールフィードで共有する" name="save_to_profile_btn"/>
<button label="メールで送信" name="save_to_email_btn"/>
<text name="fee_hint_lbl">
diff --git a/indra/newview/skins/default/xui/ja/strings.xml b/indra/newview/skins/default/xui/ja/strings.xml
index 106bf91d0c..d0e3cd87c4 100644
--- a/indra/newview/skins/default/xui/ja/strings.xml
+++ b/indra/newview/skins/default/xui/ja/strings.xml
@@ -6149,6 +6149,10 @@ www.secondlife.com から最新バージョンをダウンロードしてくだ
<string name="inventory_folder_offered-im">
フォルダ「[ITEM_NAME]」がインベントリに送られてきました。
</string>
+ <string name="bot_warning">
+[NAME]とチャットしています。個人情報を共有しないでください。
+詳細は https://second.life/scripted-agents をご覧ください。
+ </string>
<string name="share_alert">
インベントリからここにアイテムをドラッグします。
</string>
diff --git a/indra/newview/skins/default/xui/pl/panel_settings_sky_sunmoon.xml b/indra/newview/skins/default/xui/pl/panel_settings_sky_sunmoon.xml
index f807148617..7f9dee2369 100644
--- a/indra/newview/skins/default/xui/pl/panel_settings_sky_sunmoon.xml
+++ b/indra/newview/skins/default/xui/pl/panel_settings_sky_sunmoon.xml
@@ -35,8 +35,6 @@
<check_box label="Pokaż emiter" name="sunbeacon" />
</layout_panel>
<layout_panel name="moon_layout">
- <layout_stack name="moon_stack">
- <layout_panel name="moon_layout">
<text name="moon_label">
Księżyc
</text>
@@ -59,8 +57,6 @@
Jasność:
</text>
<check_box label="Pokaż emiter" name="moonbeacon" />
- </layout_panel>
- </layout_stack>
</layout_panel>
</layout_stack>
</panel>
diff --git a/indra/newview/skins/default/xui/pl/panel_snapshot_options.xml b/indra/newview/skins/default/xui/pl/panel_snapshot_options.xml
index 016b9ca197..04c01940e1 100644
--- a/indra/newview/skins/default/xui/pl/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/pl/panel_snapshot_options.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel name="panel_snapshot_options">
<button label="Zapisz na dysku twardym" name="save_to_computer_btn" />
- <button label="Zapisz do Szafy ([AMOUNT]L$)" name="save_to_inventory_btn" />
+ <button label="Zapisz do Szafy" name="save_to_inventory_btn" />
<button label="Wyślij na mój Kanał" name="save_to_profile_btn" />
<button label="Załaduj na Facebook" name="send_to_facebook_btn" />
<button label="Załaduj na Twitter" name="send_to_twitter_btn" />
diff --git a/indra/newview/skins/default/xui/pl/strings.xml b/indra/newview/skins/default/xui/pl/strings.xml
index 8032443020..65b487e1b3 100644
--- a/indra/newview/skins/default/xui/pl/strings.xml
+++ b/indra/newview/skins/default/xui/pl/strings.xml
@@ -4412,6 +4412,10 @@ Jeżeli nadal otrzymujesz ten komunikat, skontaktuj się z [SUPPORT_SITE].
<string name="inventory_folder_offered-im">
Zaoferowano folder: '[ITEM_NAME]'
</string>
+ <string name="bot_warning">
+Rozmawiasz z botem [NAME]. Nie udostępniaj żadnych danych osobowych.
+Dowiedz się więcej na https://second.life/scripted-agents.
+ </string>
<string name="share_alert">
Przeciągaj tutaj rzeczy z Szafy
</string>
diff --git a/indra/newview/skins/default/xui/pt/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/pt/panel_snapshot_inventory.xml
index f3357026d5..28a5142baa 100644
--- a/indra/newview/skins/default/xui/pt/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/pt/panel_snapshot_inventory.xml
@@ -7,7 +7,7 @@
Salvar uma imagem em seu inventário custa L$[UPLOAD_COST]. Para salvar sua imagem como uma textura, selecione um dos formatos quadrados.
</text>
<combo_box label="Resolução" name="texture_size_combo">
- <combo_box.item label="Janela ativa (512x512)" name="CurrentWindow"/>
+ <combo_box.item label="Janela ativa" name="CurrentWindow"/>
<combo_box.item label="Pequeno (128x128)" name="Small(128x128)"/>
<combo_box.item label="Médio (256x256)" name="Medium(256x256)"/>
<combo_box.item label="Grande (512x512)" name="Large(512x512)"/>
diff --git a/indra/newview/skins/default/xui/pt/panel_snapshot_options.xml b/indra/newview/skins/default/xui/pt/panel_snapshot_options.xml
index 067e5dbd76..f71bc7cd12 100644
--- a/indra/newview/skins/default/xui/pt/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/pt/panel_snapshot_options.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="panel_snapshot_options">
<button label="Salvar no disco" name="save_to_computer_btn"/>
- <button label="Salvar em inventário (L$[AMOUNT])" name="save_to_inventory_btn"/>
+ <button label="Salvar em inventário" name="save_to_inventory_btn"/>
<button label="Compartilhar no feed do perfil" name="save_to_profile_btn"/>
<button label="Compartilhar no Facebook" name="send_to_facebook_btn"/>
<button label="Compartilhar no Twitter" name="send_to_twitter_btn"/>
diff --git a/indra/newview/skins/default/xui/pt/strings.xml b/indra/newview/skins/default/xui/pt/strings.xml
index 3e33744b85..c7fe195505 100644
--- a/indra/newview/skins/default/xui/pt/strings.xml
+++ b/indra/newview/skins/default/xui/pt/strings.xml
@@ -1549,6 +1549,10 @@ If you continue to receive this message, contact the [SUPPORT_SITE].</string>
<string name="conference-title-incoming">Conversa com [AGENT_NAME]</string>
<string name="inventory_item_offered-im">Item do inventário '[ITEM_NAME]' oferecido</string>
<string name="inventory_folder_offered-im">Pasta do inventário '[ITEM_NAME]' oferecida</string>
+ <string name="bot_warning">
+Você está conversando com um bot, [NAME]. Não compartilhe informações pessoais.
+Saiba mais em https://second.life/scripted-agents.
+ </string>
<string name="facebook_post_success">Você publicou no Facebook.</string>
<string name="flickr_post_success">Você publicou no Flickr.</string>
<string name="twitter_post_success">Você publicou no Twitter.</string>
diff --git a/indra/newview/skins/default/xui/ru/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/ru/panel_snapshot_inventory.xml
index f07e12e0ed..adc612dfd8 100644
--- a/indra/newview/skins/default/xui/ru/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/ru/panel_snapshot_inventory.xml
@@ -7,7 +7,7 @@
Сохранение изображения в инвентаре стоит L$[UPLOAD_COST]. Чтобы сохранить его как текстуру, выберите один из квадратных форматов.
</text>
<combo_box label="Размер" name="texture_size_combo">
- <combo_box.item label="Текущее окно (512x512)" name="CurrentWindow"/>
+ <combo_box.item label="Текущее окно" name="CurrentWindow"/>
<combo_box.item label="Маленький (128x128)" name="Small(128x128)"/>
<combo_box.item label="Средний (256x256)" name="Medium(256x256)"/>
<combo_box.item label="Большой (512x512)" name="Large(512x512)"/>
diff --git a/indra/newview/skins/default/xui/ru/panel_snapshot_options.xml b/indra/newview/skins/default/xui/ru/panel_snapshot_options.xml
index 7ba03ee0c9..f7fda0b1dc 100644
--- a/indra/newview/skins/default/xui/ru/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/ru/panel_snapshot_options.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="panel_snapshot_options">
<button label="Сохранить на диске" name="save_to_computer_btn"/>
- <button label="Сохранить в инвентаре (L$[AMOUNT])" name="save_to_inventory_btn"/>
+ <button label="Сохранить в инвентаре" name="save_to_inventory_btn"/>
<button label="Поделиться в профиле" name="save_to_profile_btn"/>
<button label="Поделиться в Facebook" name="send_to_facebook_btn"/>
<button label="Поделиться в Twitter" name="send_to_twitter_btn"/>
diff --git a/indra/newview/skins/default/xui/ru/strings.xml b/indra/newview/skins/default/xui/ru/strings.xml
index 10b0d3578f..1f53723e92 100644
--- a/indra/newview/skins/default/xui/ru/strings.xml
+++ b/indra/newview/skins/default/xui/ru/strings.xml
@@ -4576,6 +4576,10 @@ support@secondlife.com.
<string name="inventory_folder_offered-im">
Предложена папка инвентаря «[ITEM_NAME]»
</string>
+ <string name="bot_warning">
+Вы общаетесь с ботом [NAME]. Не передавайте личные данные.
+Подробнее на https://second.life/scripted-agents.
+ </string>
<string name="share_alert">
Перетаскивайте вещи из инвентаря сюда
</string>
diff --git a/indra/newview/skins/default/xui/tr/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/tr/panel_snapshot_inventory.xml
index be5940c4b9..160cba8700 100644
--- a/indra/newview/skins/default/xui/tr/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/tr/panel_snapshot_inventory.xml
@@ -7,7 +7,7 @@
Bir görüntüyü envanterinize kaydetmenin maliyeti L$[UPLOAD_COST] olur. Görüntünüzü bir doku olarak kaydetmek için kare formatlardan birini seçin.
</text>
<combo_box label="Çözünürlük" name="texture_size_combo">
- <combo_box.item label="Mevcut Pencere(512x512)" name="CurrentWindow"/>
+ <combo_box.item label="Mevcut Pencere" name="CurrentWindow"/>
<combo_box.item label="Küçük (128x128)" name="Small(128x128)"/>
<combo_box.item label="Orta (256x256)" name="Medium(256x256)"/>
<combo_box.item label="Büyük (512x512)" name="Large(512x512)"/>
diff --git a/indra/newview/skins/default/xui/tr/panel_snapshot_options.xml b/indra/newview/skins/default/xui/tr/panel_snapshot_options.xml
index 1b48bbeec2..a028710b98 100644
--- a/indra/newview/skins/default/xui/tr/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/tr/panel_snapshot_options.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="panel_snapshot_options">
<button label="Diske Kaydet" name="save_to_computer_btn"/>
- <button label="Envantere Kaydet (L$[AMOUNT])" name="save_to_inventory_btn"/>
+ <button label="Envantere Kaydet" name="save_to_inventory_btn"/>
<button label="Profil Akışında Paylaş" name="save_to_profile_btn"/>
<button label="Facebook&apos;ta Paylaş" name="send_to_facebook_btn"/>
<button label="Twitter&apos;da Paylaş" name="send_to_twitter_btn"/>
diff --git a/indra/newview/skins/default/xui/tr/strings.xml b/indra/newview/skins/default/xui/tr/strings.xml
index d992788e13..c98de5aab9 100644
--- a/indra/newview/skins/default/xui/tr/strings.xml
+++ b/indra/newview/skins/default/xui/tr/strings.xml
@@ -4579,6 +4579,10 @@ Bu iletiyi almaya devam ederseniz, lütfen [SUPPORT_SITE] bölümüne başvurun.
<string name="inventory_folder_offered-im">
&quot;[ITEM_NAME]&quot; envanter klasörü sunuldu
</string>
+ <string name="bot_warning">
+Bir bot ile sohbet ediyorsunuz, [NAME]. Kişisel bilgilerinizi paylaşmayın.
+Daha fazla bilgi için: https://second.life/scripted-agents.
+ </string>
<string name="share_alert">
Envanterinizden buraya öğeler sürükleyin
</string>
diff --git a/indra/newview/skins/default/xui/zh/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/zh/panel_snapshot_inventory.xml
index 094bf019b4..9c45c54a5e 100644
--- a/indra/newview/skins/default/xui/zh/panel_snapshot_inventory.xml
+++ b/indra/newview/skins/default/xui/zh/panel_snapshot_inventory.xml
@@ -7,7 +7,7 @@
將圖像儲存到收納區的費用為 L$[UPLOAD_COST]。 若要將圖像存為材質,請選擇一個正方格式。
</text>
<combo_box label="解析度" name="texture_size_combo">
- <combo_box.item label="目前視窗(512x512)" name="CurrentWindow"/>
+ <combo_box.item label="目前視窗" name="CurrentWindow"/>
<combo_box.item label="小(128x128)" name="Small(128x128)"/>
<combo_box.item label="中(256x256)" name="Medium(256x256)"/>
<combo_box.item label="大(512x512)" name="Large(512x512)"/>
diff --git a/indra/newview/skins/default/xui/zh/panel_snapshot_options.xml b/indra/newview/skins/default/xui/zh/panel_snapshot_options.xml
index d7c65bb25e..d9536882ac 100644
--- a/indra/newview/skins/default/xui/zh/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/zh/panel_snapshot_options.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<panel name="panel_snapshot_options">
<button label="儲存到硬碟" name="save_to_computer_btn"/>
- <button label="儲存到收納區(L$[AMOUNT])" name="save_to_inventory_btn"/>
+ <button label="儲存到收納區" name="save_to_inventory_btn"/>
<button label="分享至檔案訊息發佈" name="save_to_profile_btn"/>
<button label="分享到臉書" name="send_to_facebook_btn"/>
<button label="分享到推特" name="send_to_twitter_btn"/>
diff --git a/indra/newview/skins/default/xui/zh/strings.xml b/indra/newview/skins/default/xui/zh/strings.xml
index d053d2b30d..59ba2a7e19 100644
--- a/indra/newview/skins/default/xui/zh/strings.xml
+++ b/indra/newview/skins/default/xui/zh/strings.xml
@@ -4572,6 +4572,10 @@ http://secondlife.com/support 求助解決問題。
<string name="inventory_folder_offered-im">
收納區資料夾&apos;[ITEM_NAME]&apos;已向人提供
</string>
+ <string name="bot_warning">
+您正在与人工智能机器人 [NAME] 聊天。请勿分享任何个人信息。
+了解更多:https://second.life/scripted-agents。
+ </string>
<string name="share_alert">
將收納區物品拖曳到這裡
</string>
diff --git a/indra/test/llhttpdate_tut.cpp b/indra/test/llhttpdate_tut.cpp
index a47602dec5..b580b09a9f 100644
--- a/indra/test/llhttpdate_tut.cpp
+++ b/indra/test/llhttpdate_tut.cpp
@@ -112,13 +112,8 @@ namespace tut
void httpdate_object::test<4>()
{
// test localization of http dates
-#if LL_WINDOWS
- const char *en_locale = "english";
- const char *fr_locale = "french";
-#else
- const char *en_locale = "en_GB.UTF-8";
+ const char *en_locale = "en_US.UTF-8";
const char *fr_locale = "fr_FR.UTF-8";
-#endif
std::string prev_locale = LLStringUtil::getLocale();
std::string prev_clocale = std::string(setlocale(LC_TIME, NULL));