diff options
Diffstat (limited to 'indra/newview')
52 files changed, 796 insertions, 260 deletions
| diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 77f0fd99bc..85431c5f84 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3748,6 +3748,17 @@        <key>Value</key>        <integer>1</integer>      </map> +    <key>EnableCollisionSounds</key> +    <map> +      <key>Comment</key> +      <string>Play sounds on collision</string> +      <key>Persist</key> +      <integer>1</integer> +      <key>Type</key> +      <string>Boolean</string> +      <key>Value</key> +      <integer>0</integer> +    </map>      <key>EnableMouselook</key>      <map>        <key>Comment</key> @@ -12663,6 +12674,17 @@        <key>Value</key>        <integer>50</integer>      </map> +    <key>TextureSaveLocation</key> +    <map> +      <key>Comment</key> +      <string>Current location for bulk saving textures to disk</string> +      <key>Persist</key> +      <integer>0</integer> +      <key>Type</key> +      <string>String</string> +      <key>Value</key> +      <string /> +    </map>      <key>ThrottleBandwidthKBPS</key>      <map>        <key>Comment</key> diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl index b768d609f4..d87403c78f 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightAlphaMaskNonIndexedF.glsl @@ -43,13 +43,13 @@ void default_lighting()  {  	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy); -	color *= vertex_color; -  	if (color.a < minimum_alpha)  	{  		discard;  	} -	 + +	color *= vertex_color; +  	color.rgb = atmosLighting(color.rgb);  	color.rgb = scaleSoftClip(color.rgb); diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl index d04cd79f4b..37cac5f437 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterAlphaMaskF.glsl @@ -43,13 +43,13 @@ void fullbright_lighting_water()  {  	vec4 color = diffuseLookup(vary_texcoord0.xy); -	color.rgb *= vertex_color.rgb; -  	if (color.a < minimum_alpha)  	{  		discard;  	} +	color.rgb *= vertex_color.rgb; +  	color.rgb = fullbrightAtmosTransport(color.rgb);  	frag_color = applyWaterFog(color); diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl index 3b9c04b22b..c98db4795c 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl @@ -41,13 +41,15 @@ VARYING vec2 vary_texcoord0;  void fullbright_lighting_water()  { -	vec4 color = texture2D(diffuseMap, vary_texcoord0.xy) * vertex_color; +	vec4 color = texture2D(diffuseMap, vary_texcoord0.xy);  	if (color.a < minimum_alpha)  	{  		discard;  	} +	color.rgb *= vertex_color.rgb; +  	color.rgb = fullbrightAtmosTransport(color.rgb);  	frag_color = applyWaterFog(color); diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl index 0916797259..9c89c09573 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskF.glsl @@ -41,13 +41,13 @@ void default_lighting_water()  {  	vec4 color = diffuseLookup(vary_texcoord0.xy); -	color.rgb *= vertex_color.rgb; -  	if (color.a < minimum_alpha)  	{  		discard;  	} +	color.rgb *= vertex_color.rgb; +  	color.rgb = atmosLighting(color.rgb);  	frag_color = applyWaterFog(color); diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl index f2a84f1d42..9de7a03180 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterAlphaMaskNonIndexedF.glsl @@ -43,13 +43,13 @@ void default_lighting_water()  {  	vec4 color = texture2D(diffuseMap,vary_texcoord0.xy); -	color.rgb *= vertex_color.rgb; -  	if (color.a < minimum_alpha)  	{  		discard;  	} +	color.rgb *= vertex_color.rgb; +  	color.rgb = atmosLighting(color.rgb);  	color = applyWaterFog(color); diff --git a/indra/newview/installers/windows/lang_pl.nsi b/indra/newview/installers/windows/lang_pl.nsiBinary files differ index 05977847b9..865e8bdeee 100644 --- a/indra/newview/installers/windows/lang_pl.nsi +++ b/indra/newview/installers/windows/lang_pl.nsi diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 7f18ea6fe2..be168ff5dd 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1049,13 +1049,14 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it  	}  	// updating inventory +    LLWearableType* wearable_type_inst = LLWearableType::getInstance();  	// TODO: Removed check for ensuring that teens don't remove undershirt and underwear. Handle later  	// note: shirt is the first non-body part wearable item. Update if wearable order changes.  	// This loop should remove all clothing, but not any body parts  	for (S32 j = 0; j < (S32)LLWearableType::WT_COUNT; j++)  	{ -		if (LLWearableType::getAssetType((LLWearableType::EType)j) == LLAssetType::AT_CLOTHING) +		if (wearable_type_inst->getAssetType((LLWearableType::EType)j) == LLAssetType::AT_CLOTHING)  		{  			removeWearable((LLWearableType::EType)j, true, 0);  		} @@ -1075,7 +1076,7 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it  			new_wearable->setName(new_item->getName());  			new_wearable->setItemID(new_item->getUUID()); -			if (LLWearableType::getAssetType(type) == LLAssetType::AT_BODYPART) +			if (wearable_type_inst->getAssetType(type) == LLAssetType::AT_BODYPART)  			{  				// exactly one wearable per body part  				setWearable(type,0,new_wearable); @@ -1162,7 +1163,7 @@ void LLAgentWearables::setWearableItem(LLInventoryItem* new_item, LLViewerWearab  			if ((old_wearable->getAssetID() == new_wearable->getAssetID()) &&  				(old_item_id == new_item->getUUID()))  			{ -				LL_DEBUGS() << "No change to wearable asset and item: " << LLWearableType::getTypeName(type) << LL_ENDL; +				LL_DEBUGS() << "No change to wearable asset and item: " << LLWearableType::getInstance()->getTypeName(type) << LL_ENDL;  				return;  			} @@ -1594,7 +1595,7 @@ void LLAgentWearables::editWearable(const LLUUID& item_id)  		return;  	} -	const BOOL disable_camera_switch = LLWearableType::getDisableCameraSwitch(wearable->getType()); +	const BOOL disable_camera_switch = LLWearableType::getInstance()->getDisableCameraSwitch(wearable->getType());  	LLPanel* panel = LLFloaterSidePanelContainer::getPanel("appearance");  	LLSidepanelAppearance::editWearable(wearable, panel, disable_camera_switch);  } diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index e8a3305645..268999bd2a 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -957,7 +957,7 @@ void recovered_item_link_cb(const LLUUID& item_id, LLWearableType::EType type, L  		// runway skip here?  	} -	LL_INFOS() << "HP " << holder->index() << " recovered item link for type " << type << LL_ENDL; +	LL_INFOS("Avatar") << "HP " << holder->index() << " recovered item link for type " << type << LL_ENDL;  	holder->eraseTypeToLink(type);  	// Add wearable to FoundData for actual wearing  	LLViewerInventoryItem *item = gInventory.getItem(item_id); @@ -1021,8 +1021,8 @@ void LLWearableHoldingPattern::recoverMissingWearable(LLWearableType::EType type  		// Try to recover by replacing missing wearable with a new one.  	LLNotificationsUtil::add("ReplacedMissingWearable"); -	LL_DEBUGS() << "Wearable " << LLWearableType::getTypeLabel(type) -				<< " could not be downloaded.  Replaced inventory item with default wearable." << LL_ENDL; +	LL_DEBUGS("Avatar") << "Wearable of type '" << LLWearableType::getInstance()->getTypeName(type) +				<< "' could not be downloaded.  Replaced inventory item with default wearable." << LL_ENDL;  	LLViewerWearable* wearable = LLWearableList::instance().createNewWearable(type, gAgentAvatarp);  	// Add a new one in the lost and found folder. diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 0b2cdff36c..208204e085 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -780,10 +780,6 @@ bool LLAppViewer::init()  	// Start of the application  	// -	// initialize LLWearableType translation bridge. -	// Memory will be cleaned up in ::cleanupClass() -	LLWearableType::initParamSingleton(new LLUITranslationBridge()); -      // initialize the LLSettingsType translation bridge.      LLTranslationBridge::ptr_t trans = std::make_shared<LLUITranslationBridge>();      LLSettingsType::initParamSingleton(trans); @@ -805,6 +801,7 @@ bool LLAppViewer::init()  	//  	init_default_trans_args(); +    // inits from settings.xml and from strings.xml  	if (!initConfiguration())  		return false; @@ -871,6 +868,10 @@ bool LLAppViewer::init()  	// Setup LLTrans after LLUI::initClass has been called.  	initStrings(); +    // initialize LLWearableType translation bridge. +    // Will immediately use LLTranslationBridge to init LLWearableDictionary +    LLWearableType::initParamSingleton(trans); +  	// Setup notifications after LLUI::initClass() has been called.  	LLNotifications::instance();  	LL_INFOS("InitInfo") << "Notifications initialized." << LL_ENDL ; diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp index b31981b235..aa2ba752b7 100644 --- a/indra/newview/llcofwearables.cpp +++ b/indra/newview/llcofwearables.cpp @@ -74,7 +74,7 @@ protected:  		}  		// Set proper label for the "Create new <WEARABLE_TYPE>" menu item. -		std::string new_label = LLTrans::getString("create_new_" + LLWearableType::getTypeName(w_type)); +		std::string new_label = LLTrans::getString("create_new_" + LLWearableType::getInstance()->getTypeName(w_type));  		menu_item->setLabel(new_label);  	} diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 7a887a2549..9baf8a0253 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -679,8 +679,12 @@ void LLFavoritesBarCtrl::changed(U32 mask)  //virtual  void LLFavoritesBarCtrl::reshape(S32 width, S32 height, BOOL called_from_parent)  { +    S32 delta_width = width - getRect().getWidth(); +    S32 delta_height = height - getRect().getHeight(); + +    bool force_update = delta_width || delta_height || sForceReshape;  	LLUICtrl::reshape(width, height, called_from_parent); -	updateButtons(); +	updateButtons(force_update);  }  void LLFavoritesBarCtrl::draw() @@ -743,8 +747,13 @@ const LLButton::Params& LLFavoritesBarCtrl::getButtonParams()  	return button_params;  } -void LLFavoritesBarCtrl::updateButtons() +void LLFavoritesBarCtrl::updateButtons(bool force_update)  { +    if (LLApp::isExiting()) +    { +        return; +    } +  	mItems.clear();  	if (!collectFavoriteItems(mItems)) @@ -775,28 +784,29 @@ void LLFavoritesBarCtrl::updateButtons()  	const child_list_t* childs = getChildList();  	child_list_const_iter_t child_it = childs->begin();  	int first_changed_item_index = 0; -	int rightest_point = getRect().mRight - mMoreTextBox->getRect().getWidth(); -	//lets find first changed button -	while (child_it != childs->end() && first_changed_item_index < mItems.size()) -	{ -		LLFavoriteLandmarkButton* button = dynamic_cast<LLFavoriteLandmarkButton*> (*child_it); -		if (button) -		{ -			const LLViewerInventoryItem *item = mItems[first_changed_item_index].get(); -			if (item) -			{ -			    // an child's order  and mItems  should be same -				if (button->getLandmarkId() != item->getUUID() // sort order has been changed -					|| button->getLabelSelected() != item->getName() // favorite's name has been changed -					|| button->getRect().mRight < rightest_point) // favbar's width has been changed -				{ -					break; -				} -			} -			first_changed_item_index++; -		} -		child_it++; -	} +    if (!force_update) +    { +        //lets find first changed button +        while (child_it != childs->end() && first_changed_item_index < mItems.size()) +        { +            LLFavoriteLandmarkButton* button = dynamic_cast<LLFavoriteLandmarkButton*> (*child_it); +            if (button) +            { +                const LLViewerInventoryItem *item = mItems[first_changed_item_index].get(); +                if (item) +                { +                    // an child's order  and mItems  should be same +                    if (button->getLandmarkId() != item->getUUID() // sort order has been changed +                        || button->getLabelSelected() != item->getName()) // favorite's name has been changed +                    { +                        break; +                    } +                } +                first_changed_item_index++; +            } +            child_it++; +        } +    }  	// now first_changed_item_index should contains a number of button that need to change  	if (first_changed_item_index <= mItems.size()) diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h index 868f1c83c8..4dcb61a091 100644 --- a/indra/newview/llfavoritesbar.h +++ b/indra/newview/llfavoritesbar.h @@ -75,7 +75,7 @@ public:  	void setLandingTab(LLUICtrl* tab) { mLandingTab = tab; }  protected: -	void updateButtons(); +    void updateButtons(bool force_update = false);  	LLButton* createButton(const LLPointer<LLViewerInventoryItem> item, const LLButton::Params& button_params, S32 x_offset );  	const LLButton::Params& getButtonParams();  	BOOL collectFavoriteItems(LLInventoryModel::item_array_t &items); diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index adc7f71586..4b22f7427b 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -248,6 +248,29 @@ void LLFloaterGodTools::processRegionInfo(LLMessageSystem* msg)  		region_flags = flags;  	} +	if (msg->has(_PREHASH_RegionInfo5)) +	{ +		F32 chat_whisper_range; +		F32 chat_normal_range; +		F32 chat_shout_range; +		F32 chat_whisper_offset; +		F32 chat_normal_offset; +		F32 chat_shout_offset; +		U32 chat_flags; + +		msg->getF32Fast(_PREHASH_RegionInfo5, _PREHASH_ChatWhisperRange, chat_whisper_range); +		msg->getF32Fast(_PREHASH_RegionInfo5, _PREHASH_ChatNormalRange, chat_normal_range); +		msg->getF32Fast(_PREHASH_RegionInfo5, _PREHASH_ChatShoutRange, chat_shout_range); +		msg->getF32Fast(_PREHASH_RegionInfo5, _PREHASH_ChatWhisperOffset, chat_whisper_offset); +		msg->getF32Fast(_PREHASH_RegionInfo5, _PREHASH_ChatNormalOffset, chat_normal_offset); +		msg->getF32Fast(_PREHASH_RegionInfo5, _PREHASH_ChatShoutOffset, chat_shout_offset); +		msg->getU32Fast(_PREHASH_RegionInfo5, _PREHASH_ChatFlags, chat_flags); + +		LL_INFOS() << "Whisper range: " << chat_whisper_range << " normal range: " << chat_normal_range << " shout range: " << chat_shout_range +			<< " whisper offset: " << chat_whisper_offset << " normal offset: " << chat_normal_offset << " shout offset: " << chat_shout_offset +			<< " chat flags: " << chat_flags << LL_ENDL; +	} +  	if (host != gAgent.getRegionHost())  	{  		// Update is for a different region than the one we're in. diff --git a/indra/newview/llfloaterlinkreplace.cpp b/indra/newview/llfloaterlinkreplace.cpp index 595d584799..8ee7a72055 100644 --- a/indra/newview/llfloaterlinkreplace.cpp +++ b/indra/newview/llfloaterlinkreplace.cpp @@ -162,7 +162,7 @@ void LLFloaterLinkReplace::onStartClicked()  		else  		{  			LLSD args; -			args["TYPE"] = LLWearableType::getTypeName(source_item->getWearableType()); +			args["TYPE"] = LLWearableType::getInstance()->getTypeName(source_item->getWearableType());  			params.substitutions(args);  			LLNotifications::instance().add(params);  		} diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 6bf2136f60..15ceb4067c 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -2332,7 +2332,7 @@ BOOL LLPanelPreference::postBuild()  	}  	//////////////////////PanelSetup /////////////////// -	if (hasChild("max_bandwidth"), TRUE) +	if (hasChild("max_bandwidth", TRUE))  	{  		mBandWidthUpdater = new LLPanelPreference::Updater(boost::bind(&handleBandwidthChanged, _1), BANDWIDTH_UPDATER_TIMEOUT);  		gSavedSettings.getControl("ThrottleBandwidthKBPS")->getSignal()->connect(boost::bind(&LLPanelPreference::Updater::update, mBandWidthUpdater, _2)); diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index ec1909d02a..17e55b5f2c 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -470,6 +470,29 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg)  		region_flags = flags;  	} +	if (msg->has(_PREHASH_RegionInfo5)) +	{ +		F32 chat_whisper_range; +		F32 chat_normal_range; +		F32 chat_shout_range; +		F32 chat_whisper_offset; +		F32 chat_normal_offset; +		F32 chat_shout_offset; +		U32 chat_flags; + +		msg->getF32Fast(_PREHASH_RegionInfo5, _PREHASH_ChatWhisperRange, chat_whisper_range); +		msg->getF32Fast(_PREHASH_RegionInfo5, _PREHASH_ChatNormalRange, chat_normal_range); +		msg->getF32Fast(_PREHASH_RegionInfo5, _PREHASH_ChatShoutRange, chat_shout_range); +		msg->getF32Fast(_PREHASH_RegionInfo5, _PREHASH_ChatWhisperOffset, chat_whisper_offset); +		msg->getF32Fast(_PREHASH_RegionInfo5, _PREHASH_ChatNormalOffset, chat_normal_offset); +		msg->getF32Fast(_PREHASH_RegionInfo5, _PREHASH_ChatShoutOffset, chat_shout_offset); +		msg->getU32Fast(_PREHASH_RegionInfo5, _PREHASH_ChatFlags, chat_flags); + +		LL_INFOS() << "Whisper range: " << chat_whisper_range << " normal range: " << chat_normal_range << " shout range: " << chat_shout_range +			<< " whisper offset: " << chat_whisper_offset << " normal offset: " << chat_normal_offset << " shout offset: " << chat_shout_offset +			<< " chat flags: " << chat_flags << LL_ENDL; +	} +  	// GENERAL PANEL  	panel = tab->getChild<LLPanel>("General");  	panel->getChild<LLUICtrl>("region_text")->setValue(LLSD(sim_name)); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index d35d8456be..4567388166 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -5469,11 +5469,20 @@ void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags)  		getClipboardEntries(true, items, disabled_items, flags);  		items.push_back(std::string("Texture Separator")); -		items.push_back(std::string("Save As")); -		if (!canSaveTexture()) -		{ -			disabled_items.push_back(std::string("Save As")); -		} +		 +        if ((flags & ITEM_IN_MULTI_SELECTION) != 0) +        { +            items.push_back(std::string("Save Selected As")); +        } +        else +        { +            items.push_back(std::string("Save As")); +            if (!canSaveTexture()) +            { +                disabled_items.push_back(std::string("Save As")); +            } +        } +  	}  	addLinkReplaceMenuOption(items, disabled_items);  	hide_context_entries(menu, items, disabled_items);	 @@ -5491,6 +5500,23 @@ void LLTextureBridge::performAction(LLInventoryModel* model, std::string action)  			preview_texture->saveAs();  		}  	} +    else if ("save_selected_as" == action) +    { +        openItem(); +        if (canSaveTexture()) +        { +            LLPreviewTexture* preview_texture = LLFloaterReg::getTypedInstance<LLPreviewTexture>("preview_texture", mUUID); +            if (preview_texture) +            { +                preview_texture->saveMultipleToFile(); +            } +        } +        else +        { +            LL_WARNS() << "You don't have permission to save " << getName() << " to disk." << LL_ENDL; +        } + +    }  	else LLItemBridge::performAction(model, action);  } @@ -6820,7 +6846,7 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags)  						disabled_items.push_back(std::string("Wearable Edit"));  					} -					if (LLWearableType::getAllowMultiwear(mWearableType)) +					if (LLWearableType::getInstance()->getAllowMultiwear(mWearableType))  					{  						items.push_back(std::string("Wearable Add"));  						if (!gAgentWearables.canAddWearable(mWearableType)) diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 7a0ea8b668..267c4e07a3 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -47,6 +47,7 @@  #include "llappviewer.h"  #include "llavataractions.h"  #include "llclipboard.h" +#include "lldirpicker.h"  #include "lldonotdisturbnotificationstorage.h"  #include "llfloatersidepanelcontainer.h"  #include "llfocusmgr.h" @@ -2492,6 +2493,10 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root      {          LLAppearanceMgr::instance().removeItemsFromAvatar(ids);      } +    else if ("save_selected_as" == action) +    { +        (new LLDirPickerThread(boost::bind(&LLInventoryAction::saveMultipleTextures, _1, selected_items, model), std::string()))->getFile(); +    }      else      {          std::set<LLFolderViewItem*>::iterator set_iter; @@ -2519,6 +2524,32 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root  	}  } +void LLInventoryAction::saveMultipleTextures(const std::vector<std::string>& filenames, std::set<LLFolderViewItem*> selected_items, LLInventoryModel* model) +{ +    gSavedSettings.setString("TextureSaveLocation", filenames[0]); +  +    LLMultiPreview* multi_previewp = new LLMultiPreview(); +    gFloaterView->addChild(multi_previewp); + +    LLFloater::setFloaterHost(multi_previewp); + +    std::set<LLFolderViewItem*>::iterator set_iter; +    for (set_iter = selected_items.begin(); set_iter != selected_items.end(); ++set_iter) +    { +        LLFolderViewItem* folder_item = *set_iter; +        if(!folder_item) continue; +        LLInvFVBridge* bridge = (LLInvFVBridge*)folder_item->getViewModelItem(); +        if(!bridge) continue; +        bridge->performAction(model, "save_selected_as"); +    } + +    LLFloater::setFloaterHost(NULL); +    if (multi_previewp) +    { +        multi_previewp->openFloater(LLSD()); +    } +} +  void LLInventoryAction::removeItemFromDND(LLFolderView* root)  {      if(gAgent.isDoNotDisturb()) diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 04eb962372..c1c4b8fe6c 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -466,6 +466,8 @@ struct LLInventoryAction  	static void onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response, LLHandle<LLFolderView> root);  	static void removeItemFromDND(LLFolderView* root); +    static void saveMultipleTextures(const std::vector<std::string>& filenames, std::set<LLFolderViewItem*> selected_items, LLInventoryModel* model); +  	static const int sConfirmOnDeleteItemsNumber;  private: diff --git a/indra/newview/llinventoryicon.cpp b/indra/newview/llinventoryicon.cpp index 81c001b8bd..44e493fdf4 100644 --- a/indra/newview/llinventoryicon.cpp +++ b/indra/newview/llinventoryicon.cpp @@ -196,7 +196,7 @@ const std::string& LLInventoryIcon::getIconName(LLInventoryType::EIconName idx)  LLInventoryType::EIconName LLInventoryIcon::assignWearableIcon(U32 misc_flag)  {  	const LLWearableType::EType wearable_type = LLWearableType::inventoryFlagsToWearableType(misc_flag); -	return LLWearableType::getIconName(wearable_type); +	return LLWearableType::getInstance()->getIconName(wearable_type);  }  LLInventoryType::EIconName LLInventoryIcon::assignSettingsIcon(U32 misc_flag) diff --git a/indra/newview/llmachineid.cpp b/indra/newview/llmachineid.cpp index 57a6ecb604..c7a0665630 100644 --- a/indra/newview/llmachineid.cpp +++ b/indra/newview/llmachineid.cpp @@ -33,237 +33,445 @@  using namespace std;  #include <comdef.h>  #include <Wbemidl.h> +#elif LL_DARWIN +#include <CoreFoundation/CoreFoundation.h> +#include <IOKit/IOKitLib.h>  #endif  unsigned char static_unique_id[] =  {0,0,0,0,0,0}; +unsigned char static_legacy_id[] =  {0,0,0,0,0,0};  bool static has_static_unique_id = false; +bool static has_static_legacy_id = false;  #if	LL_WINDOWS -class LLComInitialize +class LLWMIMethods  { -    HRESULT mHR;  public: -    LLComInitialize() +    LLWMIMethods() +    :   pLoc(NULL), +        pSvc(NULL)      { -        mHR = CoInitializeEx(0, COINIT_MULTITHREADED); -        if (FAILED(mHR)) -            LL_DEBUGS("AppInit") << "Failed to initialize COM library. Error code = 0x" << hex << mHR << LL_ENDL; +        initCOMObjects();      } -    ~LLComInitialize() +    ~LLWMIMethods()      { -        if (SUCCEEDED(mHR)) -            CoUninitialize(); +        if (isInitialized()) +        { +            cleanCOMObjects(); +        }      } -}; -#endif //LL_WINDOWS +    bool isInitialized() { return SUCCEEDED(mHR); } +    bool getWindowsProductNumber(unsigned char *unique_id, size_t len); +    bool getDiskDriveSerialNumber(unsigned char *unique_id, size_t len); +    bool getProcessorSerialNumber(unsigned char *unique_id, size_t len); +    bool getMotherboardSerialNumber(unsigned char *unique_id, size_t len); +    bool getComputerSystemProductUUID(unsigned char *unique_id, size_t len); +    bool getGenericSerialNumber(const BSTR &select, const LPCWSTR &variable, unsigned char *unique_id, size_t len, bool validate_as_uuid = false); -// get an unique machine id. -// NOT THREAD SAFE - do before setting up threads. -// MAC Address doesn't work for Windows 7 since the first returned hardware MAC address changes with each reboot,  Go figure?? +private: +    void initCOMObjects(); +    void cleanCOMObjects(); -S32 LLMachineID::init() +    HRESULT mHR; +    IWbemLocator *pLoc; +    IWbemServices *pSvc; +}; + + +void LLWMIMethods::initCOMObjects()  { -    size_t len = sizeof(static_unique_id); -    memset(static_unique_id, 0, len); -    S32 ret_code = 0; -#if	LL_WINDOWS  # pragma comment(lib, "wbemuuid.lib") +    // Step 1: -------------------------------------------------- +    // Initialize COM. ------------------------------------------ -        // algorithm to detect BIOS serial number found at: -        // http://msdn.microsoft.com/en-us/library/aa394077%28VS.85%29.aspx -        // we can't use the MAC address since on Windows 7, the first returned MAC address changes with every reboot. +    mHR = CoInitializeEx(0, COINIT_MULTITHREADED); +    if (FAILED(mHR)) +    { +        LL_DEBUGS("AppInit") << "Failed to initialize COM library. Error code = 0x" << hex << mHR << LL_ENDL; +        return; +    } +    // Step 2: -------------------------------------------------- +    // Set general COM security levels -------------------------- +    // Note: If you are using Windows 2000, you need to specify - +    // the default authentication credentials for a user by using +    // a SOLE_AUTHENTICATION_LIST structure in the pAuthList ---- +    // parameter of CoInitializeSecurity ------------------------ + +    mHR = CoInitializeSecurity( +        NULL, +        -1,                          // COM authentication +        NULL,                        // Authentication services +        NULL,                        // Reserved +        RPC_C_AUTHN_LEVEL_DEFAULT,   // Default authentication  +        RPC_C_IMP_LEVEL_IMPERSONATE, // Default Impersonation   +        NULL,                        // Authentication info +        EOAC_NONE,                   // Additional capabilities  +        NULL                         // Reserved +    ); + +    if (FAILED(mHR)) +    { +        LL_WARNS("AppInit") << "Failed to initialize security. Error code = 0x" << hex << mHR << LL_ENDL; +        CoUninitialize(); +        return;               // Program has failed. +    } -        HRESULT hres; +    // Step 3: --------------------------------------------------- +    // Obtain the initial locator to WMI ------------------------- -        // Step 1: -------------------------------------------------- -        // Initialize COM. ------------------------------------------ +    mHR = CoCreateInstance( +        CLSID_WbemLocator, +        0, +        CLSCTX_INPROC_SERVER, +        IID_IWbemLocator, (LPVOID *)&pLoc); -        LLComInitialize comInit; +    if (FAILED(mHR)) +    { +        LL_WARNS("AppInit") << "Failed to create IWbemLocator object." << " Err code = 0x" << hex << mHR << LL_ENDL; +        CoUninitialize(); +        return;               // Program has failed. +    } -        // Step 2: -------------------------------------------------- -        // Set general COM security levels -------------------------- -        // Note: If you are using Windows 2000, you need to specify - -        // the default authentication credentials for a user by using -        // a SOLE_AUTHENTICATION_LIST structure in the pAuthList ---- -        // parameter of CoInitializeSecurity ------------------------ +    // Step 4: ----------------------------------------------------- +    // Connect to WMI through the IWbemLocator::ConnectServer method + +    // Connect to the root\cimv2 namespace with +    // the current user and obtain pointer pSvc +    // to make IWbemServices calls. +    mHR = pLoc->ConnectServer( +        _bstr_t(L"ROOT\\CIMV2"), // Object path of WMI namespace +        NULL,                    // User name. NULL = current user +        NULL,                    // User password. NULL = current +        0,                       // Locale. NULL indicates current +        NULL,                    // Security flags. +        0,                       // Authority (e.g. Kerberos) +        0,                       // Context object  +        &pSvc                    // pointer to IWbemServices proxy +    ); + +    if (FAILED(mHR)) +    { +        LL_WARNS("AppInit") << "Could not connect. Error code = 0x" << hex << mHR << LL_ENDL; +        pLoc->Release(); +        CoUninitialize(); +        return;               // Program has failed. +    } -        hres =  CoInitializeSecurity( -            NULL,  -            -1,                          // COM authentication -            NULL,                        // Authentication services -            NULL,                        // Reserved -            RPC_C_AUTHN_LEVEL_DEFAULT,   // Default authentication  -            RPC_C_IMP_LEVEL_IMPERSONATE, // Default Impersonation   -            NULL,                        // Authentication info -            EOAC_NONE,                   // Additional capabilities  -            NULL                         // Reserved -            ); +    LL_DEBUGS("AppInit") << "Connected to ROOT\\CIMV2 WMI namespace" << LL_ENDL; -                           -        if (FAILED(hres)) -        { -            LL_WARNS("AppInit") << "Failed to initialize security. Error code = 0x"  << hex << hres << LL_ENDL; -            return 1;                    // Program has failed. -        } -         -        // Step 3: --------------------------------------------------- -        // Obtain the initial locator to WMI ------------------------- - -        IWbemLocator *pLoc = NULL; - -        hres = CoCreateInstance( -            CLSID_WbemLocator,              -            0,  -            CLSCTX_INPROC_SERVER,  -            IID_IWbemLocator, (LPVOID *) &pLoc); -      -        if (FAILED(hres)) -        { -            LL_WARNS("AppInit") << "Failed to create IWbemLocator object." << " Err code = 0x" << hex << hres << LL_ENDL; -            return 1;                 // Program has failed. -        } +    // Step 5: -------------------------------------------------- +    // Set security levels on the proxy ------------------------- -        // Step 4: ----------------------------------------------------- -        // Connect to WMI through the IWbemLocator::ConnectServer method - -        IWbemServices *pSvc = NULL; -    	 -        // Connect to the root\cimv2 namespace with -        // the current user and obtain pointer pSvc -        // to make IWbemServices calls. -        hres = pLoc->ConnectServer( -             _bstr_t(L"ROOT\\CIMV2"), // Object path of WMI namespace -             NULL,                    // User name. NULL = current user -             NULL,                    // User password. NULL = current -             0,                       // Locale. NULL indicates current -             NULL,                    // Security flags. -             0,                       // Authority (e.g. Kerberos) -             0,                       // Context object  -             &pSvc                    // pointer to IWbemServices proxy -             ); -         -        if (FAILED(hres)) -        { -            LL_WARNS("AppInit") << "Could not connect. Error code = 0x"  << hex << hres << LL_ENDL; -            pLoc->Release();      -            return 1;                // Program has failed. -        } +    mHR = CoSetProxyBlanket( +        pSvc,                        // Indicates the proxy to set +        RPC_C_AUTHN_WINNT,           // RPC_C_AUTHN_xxx +        RPC_C_AUTHZ_NONE,            // RPC_C_AUTHZ_xxx +        NULL,                        // Server principal name  +        RPC_C_AUTHN_LEVEL_CALL,      // RPC_C_AUTHN_LEVEL_xxx  +        RPC_C_IMP_LEVEL_IMPERSONATE, // RPC_C_IMP_LEVEL_xxx +        NULL,                        // client identity +        EOAC_NONE                    // proxy capabilities  +    ); + +    if (FAILED(mHR)) +    { +        LL_WARNS("AppInit") << "Could not set proxy blanket. Error code = 0x" << hex << mHR << LL_ENDL; +        cleanCOMObjects(); +        return;               // Program has failed. +    } +} + + +void LLWMIMethods::cleanCOMObjects() +{ +    pSvc->Release(); +    pLoc->Release(); +    CoUninitialize(); +} + +bool LLWMIMethods::getWindowsProductNumber(unsigned char *unique_id, size_t len) +{ +    // wmic path Win32_ComputerSystemProduct get UUID +    return getGenericSerialNumber(bstr_t("SELECT * FROM Win32_OperatingSystem"), L"SerialNumber", unique_id, len); +} + +bool LLWMIMethods::getDiskDriveSerialNumber(unsigned char *unique_id, size_t len) +{ +    // wmic path Win32_DiskDrive get DeviceID,SerialNumber +    return getGenericSerialNumber(bstr_t("SELECT * FROM Win32_DiskDrive"), L"SerialNumber", unique_id, len); +} + +bool LLWMIMethods::getProcessorSerialNumber(unsigned char *unique_id, size_t len) +{ +    // wmic path Win32_Processor get DeviceID,ProcessorId +    return getGenericSerialNumber(bstr_t("SELECT * FROM Win32_Processor"), L"ProcessorId", unique_id, len); +} -        LL_DEBUGS("AppInit") << "Connected to ROOT\\CIMV2 WMI namespace" << LL_ENDL; +bool LLWMIMethods::getMotherboardSerialNumber(unsigned char *unique_id, size_t len) +{ +    // wmic path Win32_Processor get DeviceID,ProcessorId +    return getGenericSerialNumber(bstr_t("SELECT * FROM Win32_BaseBoard"), L"SerialNumber", unique_id, len); +} + +bool LLWMIMethods::getComputerSystemProductUUID(unsigned char *unique_id, size_t len) +{ +    // UUID from Win32_ComputerSystemProduct is motherboard's uuid and is identical to csproduct's uuid +    // wmic csproduct get name,identifyingnumber,uuid +    // wmic path Win32_ComputerSystemProduct get UUID +    return getGenericSerialNumber(bstr_t("SELECT * FROM Win32_ComputerSystemProduct"), L"UUID", unique_id, len, true); +} +bool LLWMIMethods::getGenericSerialNumber(const BSTR &select, const LPCWSTR &variable, unsigned char *unique_id, size_t len, bool validate_as_uuid) +{ +    if (!isInitialized()) +    { +        return false; +    } -        // Step 5: -------------------------------------------------- -        // Set security levels on the proxy ------------------------- +    HRESULT hres; -        hres = CoSetProxyBlanket( -           pSvc,                        // Indicates the proxy to set -           RPC_C_AUTHN_WINNT,           // RPC_C_AUTHN_xxx -           RPC_C_AUTHZ_NONE,            // RPC_C_AUTHZ_xxx -           NULL,                        // Server principal name  -           RPC_C_AUTHN_LEVEL_CALL,      // RPC_C_AUTHN_LEVEL_xxx  -           RPC_C_IMP_LEVEL_IMPERSONATE, // RPC_C_IMP_LEVEL_xxx -           NULL,                        // client identity -           EOAC_NONE                    // proxy capabilities  -        ); +    // Step 6: -------------------------------------------------- +    // Use the IWbemServices pointer to make requests of WMI ---- -        if (FAILED(hres)) +    // For example, get the name of the operating system +    IEnumWbemClassObject* pEnumerator = NULL; +    hres = pSvc->ExecQuery( +        bstr_t("WQL"), +        select, +        WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, +        NULL, +        &pEnumerator); + +    if (FAILED(hres)) +    { +        LL_WARNS("AppInit") << "Query for operating system name failed." << " Error code = 0x" << hex << hres << LL_ENDL; +        return false;               // Program has failed. +    } + +    // Step 7: ------------------------------------------------- +    // Get the data from the query in step 6 ------------------- + +    IWbemClassObject *pclsObj = NULL; +    ULONG uReturn = 0; +    bool found = false; + +    while (pEnumerator) +    { +        HRESULT hr = pEnumerator->Next(WBEM_INFINITE, 1, +            &pclsObj, &uReturn); + +        if (0 == uReturn)          { -            LL_WARNS("AppInit") << "Could not set proxy blanket. Error code = 0x"   << hex << hres << LL_ENDL; -            pSvc->Release(); -            pLoc->Release();      -            return 1;               // Program has failed. +            break;          } -        // Step 6: -------------------------------------------------- -        // Use the IWbemServices pointer to make requests of WMI ---- - -        // For example, get the name of the operating system -        IEnumWbemClassObject* pEnumerator = NULL; -        hres = pSvc->ExecQuery( -            bstr_t("WQL"),  -            bstr_t("SELECT * FROM Win32_OperatingSystem"), -            WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,  -            NULL, -            &pEnumerator); -         -        if (FAILED(hres)) +        VARIANT vtProp; + +        // Get the value of the Name property +        hr = pclsObj->Get(variable, 0, &vtProp, 0, 0); +        if (FAILED(hr))          { -            LL_WARNS("AppInit") << "Query for operating system name failed." << " Error code = 0x"  << hex << hres << LL_ENDL; -            pSvc->Release(); -            pLoc->Release(); -            return 1;               // Program has failed. +            LL_WARNS() << "Failed to get SerialNumber. Error code = 0x" << hex << hres << LL_ENDL; +            pclsObj->Release(); +            pclsObj = NULL; +            continue;          } -        // Step 7: ------------------------------------------------- -        // Get the data from the query in step 6 ------------------- -      -        IWbemClassObject *pclsObj = NULL; -        ULONG uReturn = 0; -        -        while (pEnumerator) +        // use characters in the returned Serial Number to create a byte array of size len +        BSTR serialNumber(vtProp.bstrVal); +        unsigned int serial_size = SysStringLen(serialNumber); +        if (serial_size < 1) // < len?          { -            HRESULT hr = pEnumerator->Next(WBEM_INFINITE, 1,  -                &pclsObj, &uReturn); +            VariantClear(&vtProp); +            pclsObj->Release(); +            pclsObj = NULL; +            continue; +        } -            if(0 == uReturn) +        if (validate_as_uuid) +        { +            std::wstring ws(serialNumber, serial_size); +            std::string str(ws.begin(), ws.end()); + +            if (!LLUUID::validate(str))              { -                break; +                VariantClear(&vtProp); +                pclsObj->Release(); +                pclsObj = NULL; +                continue;              } -            VARIANT vtProp; +            static const LLUUID f_uuid("FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF"); +            LLUUID id(str); -            // Get the value of the Name property -            hr = pclsObj->Get(L"SerialNumber", 0, &vtProp, 0, 0); -            if (FAILED(hr)) +            if (id.isNull() || id == f_uuid)              { -                LL_WARNS() << "Failed to get SerialNumber. Error code = 0x" << hex << hres << LL_ENDL; +                // Not unique id +                VariantClear(&vtProp);                  pclsObj->Release();                  pclsObj = NULL;                  continue;              } -            LL_INFOS("AppInit") << " Serial Number : " << vtProp.bstrVal << LL_ENDL; +        } +        LL_INFOS("AppInit") << " Serial Number : " << vtProp.bstrVal << LL_ENDL; -            // use characters in the returned Serial Number to create a byte array of size len -            BSTR serialNumber ( vtProp.bstrVal); -            unsigned int serial_size = SysStringLen(serialNumber); -            unsigned int j = 0; +        unsigned int j = 0; -            while (j < serial_size && vtProp.bstrVal[j] != 0) +        while (j < serial_size && vtProp.bstrVal[j] != 0) +        { +            for (unsigned int i = 0; i < len; i++)              { -                for (unsigned int i = 0; i < len; i++) +                if (j >= serial_size || vtProp.bstrVal[j] == 0) +                    break; + +                unique_id[i] = (unsigned int)(unique_id[i] + serialNumber[j]); +                j++; +            } +        } +        VariantClear(&vtProp); + +        pclsObj->Release(); +        pclsObj = NULL; +        found = true; +        break; +    } + +    // Cleanup +    // ======== + +    if (pEnumerator) +        pEnumerator->Release(); + +    return found; +} +#elif LL_DARWIN +bool getSerialNumber(unsigned char *unique_id, size_t len) +{ +    CFStringRef serial_cf_str = NULL; +    io_service_t platformExpert = IOServiceGetMatchingService(kIOMasterPortDefault, +                                                                 IOServiceMatching("IOPlatformExpertDevice")); +    if (platformExpert) +    { +        serial_cf_str = (CFStringRef) IORegistryEntryCreateCFProperty(platformExpert, +                                                                     CFSTR(kIOPlatformSerialNumberKey), +                                                                     kCFAllocatorDefault, 0); +        IOObjectRelease(platformExpert); +    } +     +    if (serial_cf_str) +    { +        char buffer[64] = {0}; +        std::string serial_str(""); +        if (CFStringGetCString(serial_cf_str, buffer, 64, kCFStringEncodingUTF8)) +        { +            serial_str = buffer; +        } + +        S32 serial_size = serial_str.size(); +         +        if(serial_str.size() > 0) +        { +            S32 j = 0; +            while (j < serial_size) +            { +                for (S32 i = 0; i < len; i++)                  { -                    if (j >= serial_size || vtProp.bstrVal[j] == 0) +                    if (j >= serial_size)                          break; -                     -                    static_unique_id[i] = (unsigned int)(static_unique_id[i] + serialNumber[j]); + +                    unique_id[i] = (unsigned int)(unique_id[i] + serial_str[j]);                      j++;                  }              } -            VariantClear(&vtProp); +            return true; +        } +    } +    return false; +} +#endif -            pclsObj->Release(); -            pclsObj = NULL; -            break; +// get an unique machine id. +// NOT THREAD SAFE - do before setting up threads. +// MAC Address doesn't work for Windows 7 since the first returned hardware MAC address changes with each reboot,  Go figure?? + +S32 LLMachineID::init() +{ +    size_t len = sizeof(static_unique_id); +    memset(static_unique_id, 0, len); +    S32 ret_code = 0; +#if	LL_WINDOWS + +    LLWMIMethods comInit; + +    if (comInit.getWindowsProductNumber(static_legacy_id, len)) +    { +        // Bios id can change on windows update, so it is not the best id to use +        // but since old viewer already use them, we might need this id to decode +        // passwords +        has_static_legacy_id = true; +    } + +    // Try motherboard/bios id, if it is present it is supposed to be sufficiently unique +    if (comInit.getComputerSystemProductUUID(static_unique_id, len)) +    { +        has_static_unique_id = true; +        LL_DEBUGS("AppInit") << "Using product uuid as unique id" << LL_ENDL; +    } + +    // Fallback to legacy +    if (!has_static_unique_id) +    { +        if (has_static_legacy_id) +        { +            memcpy(static_unique_id, &static_legacy_id, len); +            // Since ids are identical, mark legacy as not present +            // to not cause retry's in sechandler +            has_static_legacy_id = false; +            has_static_unique_id = true; +            LL_DEBUGS("AppInit") << "Using legacy serial" << LL_ENDL; +        } +        else +        { +            return 1; // Program has failed.          } +    } -        // Cleanup -        // ======== -         -        if (pSvc) -            pSvc->Release(); -        if (pLoc) -            pLoc->Release(); -        if (pEnumerator) -            pEnumerator->Release(); -        ret_code=0; -#else -        unsigned char * staticPtr = (unsigned char *)(&static_unique_id[0]); +    ret_code=0; +#elif LL_DARWIN +    if (getSerialNumber(static_unique_id, len)) +    { +        has_static_unique_id = true; +        LL_DEBUGS("AppInit") << "Using Serial number as unique id" << LL_ENDL; +    } + +    { +        unsigned char * staticPtr = (unsigned char *)(&static_legacy_id[0]);          ret_code = LLUUID::getNodeID(staticPtr); +        has_static_legacy_id = true; +    } + +    // Fallback to legacy +    if (!has_static_unique_id) +    { +        if (has_static_legacy_id) +        { +            memcpy(static_unique_id, &static_legacy_id, len); +            // Since ids are identical, mark legacy as not present +            // to not cause retry's in sechandler +            has_static_legacy_id = false; +            has_static_unique_id = true; +            LL_DEBUGS("AppInit") << "Using legacy serial" << LL_ENDL; +        } +    } +#else +    unsigned char * staticPtr = (unsigned char *)(&static_legacy_id[0]); +    ret_code = LLUUID::getNodeID(staticPtr); +    has_static_unique_id = true; +    has_static_legacy_id = false;  #endif -        has_static_unique_id = true;          LL_INFOS("AppInit") << "UniqueID: 0x";          // Code between here and LL_ENDL is not executed unless the LL_DEBUGS @@ -292,3 +500,13 @@ S32 LLMachineID::getUniqueID(unsigned char *unique_id, size_t len)      }      return 0;  } + +S32 LLMachineID::getLegacyID(unsigned char *unique_id, size_t len) +{ +    if (has_static_legacy_id) +    { +        memcpy(unique_id, &static_legacy_id, len); +        return 1; +    } +    return 0; +} diff --git a/indra/newview/llmachineid.h b/indra/newview/llmachineid.h index 6ef8c36fdb..ec1e855031 100644 --- a/indra/newview/llmachineid.h +++ b/indra/newview/llmachineid.h @@ -34,6 +34,8 @@ public:  	LLMachineID();  	virtual	~LLMachineID();      static S32 getUniqueID(unsigned char *unique_id, size_t len); +    // fallback id for windows +    static S32 getLegacyID(unsigned char *unique_id, size_t len);      static S32 init();  protected: diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index 272e7ae351..ca7bd8cb2c 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -893,7 +893,7 @@ void LLOutfitGalleryContextMenu::onOutfitsRemovalConfirmation(const LLSD& notifi  void LLOutfitGalleryContextMenu::onCreate(const LLSD& data)  { -    LLWearableType::EType type = LLWearableType::typeNameToType(data.asString()); +    LLWearableType::EType type = LLWearableType::getInstance()->typeNameToType(data.asString());      if (type == LLWearableType::WT_NONE)      {          LL_WARNS() << "Invalid wearable type" << LL_ENDL; diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 71ab826e1c..a71432e314 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -1210,7 +1210,7 @@ void LLOutfitListGearMenuBase::onRename()  void LLOutfitListGearMenuBase::onCreate(const LLSD& data)  { -    LLWearableType::EType type = LLWearableType::typeNameToType(data.asString()); +    LLWearableType::EType type = LLWearableType::getInstance()->typeNameToType(data.asString());      if (type == LLWearableType::WT_NONE)      {          LL_WARNS() << "Invalid wearable type" << LL_ENDL; diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index c601a6c210..be11a4a9f3 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -1276,7 +1276,7 @@ void LLPanelEditWearable::changeCamera(U8 subpart)  {  	// Don't change the camera if this type doesn't have a camera switch.  	// Useful for wearables like physics that don't have an associated physical body part. -	if (LLWearableType::getDisableCameraSwitch(mWearablePtr->getType())) +	if (LLWearableType::getInstance()->getDisableCameraSwitch(mWearablePtr->getType()))  	{  		return;  	} diff --git a/indra/newview/llpanelgroupcreate.cpp b/indra/newview/llpanelgroupcreate.cpp index 052212dc27..52be75072c 100644 --- a/indra/newview/llpanelgroupcreate.cpp +++ b/indra/newview/llpanelgroupcreate.cpp @@ -45,6 +45,7 @@  #include "llfloaterreg.h"  #include "llfloater.h"  #include "llgroupmgr.h" +#include "llstatusbar.h" // to re-request balance  #include "lltrans.h"  #include "llnotificationsutil.h"  #include "lluicolortable.h" @@ -117,6 +118,7 @@ void LLPanelGroupCreate::refreshCreatedGroup(const LLUUID& group_id)      params["group_id"] = group_id;      params["open_tab_name"] = "panel_group_info_sidetray";      LLFloaterSidePanelContainer::showPanel("people", "panel_group_info_sidetray", params); +    LLStatusBar::sendMoneyBalanceRequest();  }  void LLPanelGroupCreate::addMembershipRow(const std::string &name) diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 28a020870f..984fb49c83 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -97,7 +97,7 @@ std::string LLShopURLDispatcher::resolveURL(LLWearableType::EType wearable_type,  {  	const std::string prefix = "MarketplaceURL";  	const std::string sex_str = (sex == SEX_MALE) ? "Male" : "Female"; -	const std::string type_str = LLWearableType::getTypeName(wearable_type); +	const std::string type_str = LLWearableType::getInstance()->getTypeName(wearable_type);  	std::string setting_name = prefix; @@ -173,7 +173,7 @@ public:  private:  	static void onCreate(const LLSD& param)  	{ -		LLWearableType::EType type = LLWearableType::typeNameToType(param.asString()); +		LLWearableType::EType type = LLWearableType::getInstance()->typeNameToType(param.asString());  		if (type == LLWearableType::WT_NONE)  		{  			LL_WARNS() << "Invalid wearable type" << LL_ENDL; @@ -188,19 +188,20 @@ private:  	{  		LLView* menu_clothes	= gMenuHolder->getChildView("COF.Gear.New_Clothes", FALSE);  		LLView* menu_bp			= gMenuHolder->getChildView("COF.Gear.New_Body_Parts", FALSE); +		LLWearableType * wearable_type_inst = LLWearableType::getInstance();  		for (U8 i = LLWearableType::WT_SHAPE; i != (U8) LLWearableType::WT_COUNT; ++i)  		{  			LLWearableType::EType type = (LLWearableType::EType) i; -			const std::string& type_name = LLWearableType::getTypeName(type); +			const std::string& type_name = wearable_type_inst->getTypeName(type);  			LLMenuItemCallGL::Params p;  			p.name = type_name; -			p.label = LLTrans::getString(LLWearableType::getTypeDefaultNewName(type)); +			p.label = LLTrans::getString(wearable_type_inst->getTypeDefaultNewName(type));  			p.on_click.function_name = "Wearable.Create";  			p.on_click.parameter = LLSD(type_name); -            LLView* parent = LLWearableType::getAssetType(type) == LLAssetType::AT_CLOTHING ? menu_clothes : menu_bp; +			LLView* parent = wearable_type_inst->getAssetType(type) == LLAssetType::AT_CLOTHING ? menu_clothes : menu_bp;  			LLUICtrlFactory::create<LLMenuItemCallGL>(p, parent);  		}  	} diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index 1b60610668..59be35fe92 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -232,6 +232,7 @@ void LLPreviewNotecard::loadAsset()  	if (!editor)  		return; +	bool fail = false;  	if(item)  	{ @@ -315,7 +316,31 @@ void LLPreviewNotecard::loadAsset()  			getChildView("Delete")->setEnabled(TRUE);  		}  	} -	else +    else if (mObjectUUID.notNull() && mItemUUID.notNull()) +    { +        LLViewerObject* objectp = gObjectList.findObject(mObjectUUID); +        if (objectp && (objectp->isInventoryPending() || objectp->isInventoryDirty())) +        { +            // It's a notecard in object's inventory and we failed to get it because inventory is not up to date. +            // Subscribe for callback and retry at inventoryChanged() +            registerVOInventoryListener(objectp, NULL); //removes previous listener + +            if (objectp->isInventoryDirty()) +            { +                objectp->requestInventory(); +            } +        } +        else +        { +            fail = true; +        } +    } +    else +    { +        fail = true; +    } + +	if (fail)  	{  		editor->setText(LLStringUtil::null);  		editor->makePristine(); @@ -600,6 +625,17 @@ void LLPreviewNotecard::syncExternal()  	}  } +/*virtual*/ +void LLPreviewNotecard::inventoryChanged(LLViewerObject* object, +    LLInventoryObject::object_list_t* inventory, +    S32 serial_num, +    void* user_data) +{ +    removeVOInventoryListener(); +    loadAsset(); +} + +  void LLPreviewNotecard::deleteNotecard()  {  	LLNotificationsUtil::add("DeleteNotecard", LLSD(), LLSD(), boost::bind(&LLPreviewNotecard::handleConfirmDeleteDialog,this, _1, _2)); diff --git a/indra/newview/llpreviewnotecard.h b/indra/newview/llpreviewnotecard.h index d9c14815c1..3a706b8645 100644 --- a/indra/newview/llpreviewnotecard.h +++ b/indra/newview/llpreviewnotecard.h @@ -31,6 +31,7 @@  #include "llassetstorage.h"  #include "llpreviewscript.h"  #include "lliconctrl.h" +#include "llvoinventorylistener.h"  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  // Class LLPreviewNotecard @@ -41,7 +42,7 @@  class LLViewerTextEditor;  class LLButton; -class LLPreviewNotecard : public LLPreview +class LLPreviewNotecard : public LLPreview, public LLVOInventoryListener  {  public:  	LLPreviewNotecard(const LLSD& key); @@ -75,6 +76,11 @@ public:  	void syncExternal(); +    void inventoryChanged(LLViewerObject* object, +        LLInventoryObject::object_list_t* inventory, +        S32 serial_num, +        void* user_data) override; +  protected:  	void updateTitleButtons() override; diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 1e91da529c..53869606bb 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -50,6 +50,7 @@  #include "llviewertexture.h"  #include "llviewertexturelist.h"  #include "lluictrlfactory.h" +#include "llviewercontrol.h"  #include "llviewerwindow.h"  #include "lllineeditor.h" @@ -317,6 +318,44 @@ void LLPreviewTexture::saveTextureToFile(const std::vector<std::string>& filenam  		0, TRUE, FALSE, new LLUUID(mItemUUID), &mCallbackTextureList);  } + +void LLPreviewTexture::saveMultipleToFile() +{ +    std::string texture_location(gSavedSettings.getString("TextureSaveLocation"));	 +    std::string texture_name = getItem()->getName(); +     +    std::string filepath; +    S32 i = 0; +    S32 err = 0; +    std::string extension(".png"); +    do +    { +        filepath = texture_location; +        filepath += gDirUtilp->getDirDelimiter(); +        filepath += texture_name; + +        if (i != 0) +        { +            filepath += llformat("_%.3d", i); +        } + +        filepath += extension; + +        llstat stat_info; +        err = LLFile::stat( filepath, &stat_info ); +        i++; +    } while (-1 != err);  // Search until the file is not found (i.e., stat() gives an error). +     +     +    mSaveFileName = filepath; +    mLoadingFullImage = TRUE; +    getWindow()->incBusyCount(); + +    mImage->forceToSaveRawImage(0);//re-fetch the raw image if the old one is removed. +    mImage->setLoadedCallback(LLPreviewTexture::onFileLoadedForSave, +        0, TRUE, FALSE, new LLUUID(mItemUUID), &mCallbackTextureList); +} +  // virtual  void LLPreviewTexture::reshape(S32 width, S32 height, BOOL called_from_parent)  { diff --git a/indra/newview/llpreviewtexture.h b/indra/newview/llpreviewtexture.h index ad77d9e118..cc6c7854b6 100644 --- a/indra/newview/llpreviewtexture.h +++ b/indra/newview/llpreviewtexture.h @@ -63,6 +63,7 @@ public:  	void 				openToSave();  	void				saveTextureToFile(const std::vector<std::string>& filenames); +    void                saveMultipleToFile();  	static void			onSaveAsBtn(void* data); diff --git a/indra/newview/llregioninfomodel.cpp b/indra/newview/llregioninfomodel.cpp index 7daaa7ef8e..6caec6ec4a 100644 --- a/indra/newview/llregioninfomodel.cpp +++ b/indra/newview/llregioninfomodel.cpp @@ -173,6 +173,29 @@ void LLRegionInfoModel::update(LLMessageSystem* msg)  		mRegionFlags = flags;  	} +	if (msg->has(_PREHASH_RegionInfo5)) +	{ +		F32 chat_whisper_range; +		F32 chat_normal_range; +		F32 chat_shout_range; +		F32 chat_whisper_offset; +		F32 chat_normal_offset; +		F32 chat_shout_offset; +		U32 chat_flags; + +		msg->getF32Fast(_PREHASH_RegionInfo5, _PREHASH_ChatWhisperRange, chat_whisper_range); +		msg->getF32Fast(_PREHASH_RegionInfo5, _PREHASH_ChatNormalRange, chat_normal_range); +		msg->getF32Fast(_PREHASH_RegionInfo5, _PREHASH_ChatShoutRange, chat_shout_range); +		msg->getF32Fast(_PREHASH_RegionInfo5, _PREHASH_ChatWhisperOffset, chat_whisper_offset); +		msg->getF32Fast(_PREHASH_RegionInfo5, _PREHASH_ChatNormalOffset, chat_normal_offset); +		msg->getF32Fast(_PREHASH_RegionInfo5, _PREHASH_ChatShoutOffset, chat_shout_offset); +		msg->getU32Fast(_PREHASH_RegionInfo5, _PREHASH_ChatFlags, chat_flags); + +		LL_INFOS() << "Whisper range: " << chat_whisper_range << " normal range: " << chat_normal_range << " shout range: " << chat_shout_range +			<< " whisper offset: " << chat_whisper_offset << " normal offset: " << chat_normal_offset << " shout offset: " << chat_shout_offset +			<< " chat flags: " << chat_flags << LL_ENDL; +	} +  	// the only reasonable way to decide if we actually have any data is to  	// check to see if any of these fields have nonzero sizes  	if (msg->getSize(_PREHASH_RegionInfo2, _PREHASH_ProductSKU) > 0 || diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp index 737ef30ada..dcedf5858a 100644 --- a/indra/newview/llsechandler_basic.cpp +++ b/indra/newview/llsechandler_basic.cpp @@ -1302,8 +1302,8 @@ LLSecAPIBasicHandler::~LLSecAPIBasicHandler()  	_writeProtectedData();  } -void LLSecAPIBasicHandler::_readProtectedData() -{	 +void LLSecAPIBasicHandler::_readProtectedData(unsigned char *unique_id, U32 id_len) +{  	// attempt to load the file into our map  	LLPointer<LLSDParser> parser = new LLSDXMLParser();  	llifstream protected_data_stream(mProtectedDataFilename.c_str(),  @@ -1314,9 +1314,7 @@ void LLSecAPIBasicHandler::_readProtectedData()  		U8 buffer[BUFFER_READ_SIZE];  		U8 decrypted_buffer[BUFFER_READ_SIZE];  		int decrypted_length;	 -		unsigned char unique_id[MAC_ADDRESS_BYTES]; -        LLMachineID::getUniqueID(unique_id, sizeof(unique_id)); -		LLXORCipher cipher(unique_id, sizeof(unique_id)); +		LLXORCipher cipher(unique_id, id_len);  		// read in the salt and key  		protected_data_stream.read((char *)salt, STORE_SALT_SIZE); @@ -1367,6 +1365,30 @@ void LLSecAPIBasicHandler::_readProtectedData()  	}  } +void LLSecAPIBasicHandler::_readProtectedData() +{ +    unsigned char unique_id[MAC_ADDRESS_BYTES]; +    try +    { +        // try default id +        LLMachineID::getUniqueID(unique_id, sizeof(unique_id)); +        _readProtectedData(unique_id, sizeof(unique_id)); +    } +    catch(LLProtectedDataException&) +    { +        // try with legacy id, it will return false if it is identical to getUniqueID +        // or if it is not assigned/not in use +        if (LLMachineID::getLegacyID(unique_id, sizeof(unique_id))) +        { +            _readProtectedData(unique_id, sizeof(unique_id)); +        } +        else +        { +            throw; +        } +    } +} +  void LLSecAPIBasicHandler::_writeProtectedData()  {	  	std::ostringstream formatted_data_ostream; diff --git a/indra/newview/llsechandler_basic.h b/indra/newview/llsechandler_basic.h index 0bc7f5230f..b21a5d08f9 100644 --- a/indra/newview/llsechandler_basic.h +++ b/indra/newview/llsechandler_basic.h @@ -326,6 +326,7 @@ public:  protected: +	void _readProtectedData(unsigned char *unique_id, U32 id_len);  	void _readProtectedData();  	void _writeProtectedData();  	std::string _legacyLoadPassword(); diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 48151c17ea..1158f3c5dc 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -206,7 +206,7 @@ void LLSidepanelAppearance::updateToVisibility(const LLSD &new_visibility)  			// when editing its physics.  			if (!gAgentCamera.cameraCustomizeAvatar())  			{ -				LLVOAvatarSelf::onCustomizeStart(LLWearableType::getDisableCameraSwitch(wearable_ptr->getType())); +				LLVOAvatarSelf::onCustomizeStart(LLWearableType::getInstance()->getDisableCameraSwitch(wearable_ptr->getType()));  			}  			if (is_wearable_edit_visible)  			{ diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 322d0bc727..486599af8d 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -1094,8 +1094,6 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l  				final_name = LLTrans::getString("TooltipPerson");;  			} -			// *HACK: We may select this object, so pretend it was clicked -			mPick = mHoverPick;  			LLInspector::Params p;  			p.fillFrom(LLUICtrlFactory::instance().getDefaultParams<LLInspector>());  			p.message(final_name); @@ -1207,8 +1205,6 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l  			if (show_all_object_tips || needs_tip)  			{ -				// We may select this object, so pretend it was clicked -				mPick = mHoverPick;  				LLInspector::Params p;  				p.fillFrom(LLUICtrlFactory::instance().getDefaultParams<LLInspector>());  				p.message(tooltip_msg); diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 76dc9a6790..89c600fc2c 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -143,6 +143,20 @@ static bool handleSetShaderChanged(const LLSD& newvalue)  	gBumpImageList.destroyGL();  	gBumpImageList.restoreGL(); +    if (gPipeline.isInit()) +    { +        // ALM depends onto atmospheric shaders, state might have changed +        bool old_state = LLPipeline::sRenderDeferred; +        LLPipeline::refreshCachedSettings(); +        gPipeline.updateRenderDeferred(); +        if (old_state != LLPipeline::sRenderDeferred) +        { +            gPipeline.releaseGLBuffers(); +            gPipeline.createGLBuffers(); +            gPipeline.resetVertexBuffers(); +        } +    } +  	// else, leave terrain detail as is  	LLViewerShaderMgr::instance()->setShaders();  	return true; diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index bbed741a33..55ac817479 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1756,7 +1756,7 @@ void menu_create_inventory_item(LLInventoryPanel* panel, LLFolderBridge *bridge,  	else  	{  		// Use for all clothing and body parts.  Adding new wearable types requires updating LLWearableDictionary. -		LLWearableType::EType wearable_type = LLWearableType::typeNameToType(type_name); +		LLWearableType::EType wearable_type = LLWearableType::getInstance()->typeNameToType(type_name);  		if (wearable_type >= LLWearableType::WT_SHAPE && wearable_type < LLWearableType::WT_COUNT)  		{  			const LLUUID parent_id = bridge ? bridge->getUUID() : LLUUID::null; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 9d05f59b09..87967502d2 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -8489,7 +8489,7 @@ class LLEditEnableTakeOff : public view_listener_t  	bool handleEvent(const LLSD& userdata)  	{  		std::string clothing = userdata.asString(); -		LLWearableType::EType type = LLWearableType::typeNameToType(clothing); +		LLWearableType::EType type = LLWearableType::getInstance()->typeNameToType(clothing);  		if (type >= LLWearableType::WT_SHAPE && type < LLWearableType::WT_COUNT)  			return LLAgentWearables::selfHasWearable(type);  		return false; @@ -8505,7 +8505,7 @@ class LLEditTakeOff : public view_listener_t  			LLAppearanceMgr::instance().removeAllClothesFromAvatar();  		else  		{ -			LLWearableType::EType type = LLWearableType::typeNameToType(clothing); +			LLWearableType::EType type = LLWearableType::getInstance()->typeNameToType(clothing);  			if (type >= LLWearableType::WT_SHAPE   				&& type < LLWearableType::WT_COUNT  				&& (gAgentWearables.getWearableCount(type) > 0)) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 458fc3b13d..126d146ac6 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -38,6 +38,7 @@  #include "llfollowcamparams.h"  #include "llinventorydefines.h"  #include "lllslconstants.h" +#include "llmaterialtable.h"  #include "llregionhandle.h"  #include "llsd.h"  #include "llsdserialize.h" @@ -3857,6 +3858,11 @@ void process_sound_trigger(LLMessageSystem *msg, void **)  		return;  	} +	if (LLMaterialTable::basic.isCollisionSound(sound_id) && !gSavedSettings.getBOOL("EnableCollisionSounds")) +	{ +		return; +	} +  	gAudiop->triggerSound(sound_id, owner_id, gain, LLAudioEngine::AUDIO_TYPE_SFX, pos_global);  } diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 2fde4fe49c..d337f2fb6d 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -2807,7 +2807,6 @@ void LLViewerRegion::unpackRegionHandshake()  		mProductName = productName;  	} -  	mCentralBakeVersion = region_protocols & 1; // was (S32)gSavedSettings.getBOOL("UseServerTextureBaking");  	LLVLComposition *compp = getComposition();  	if (compp) diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index be5c22e7c3..945b51d819 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -466,8 +466,8 @@ void LLViewerShaderMgr::setShaders()      bool canRenderDeferred       = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred");      bool hasWindLightShaders     = LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders");      S32 shadow_detail            = gSavedSettings.getS32("RenderShadowDetail"); -    bool useRenderDeferred       = canRenderDeferred && gSavedSettings.getBOOL("RenderDeferred") && gSavedSettings.getBOOL("RenderAvatarVP");      bool doingWindLight          = hasWindLightShaders && gSavedSettings.getBOOL("WindLightUseAtmosShaders"); +    bool useRenderDeferred       = doingWindLight && canRenderDeferred && gSavedSettings.getBOOL("RenderDeferred") && gSavedSettings.getBOOL("RenderAvatarVP");      //using shaders, disable fixed function      LLGLSLShader::sNoFixedFunction = true; diff --git a/indra/newview/llviewerwearable.cpp b/indra/newview/llviewerwearable.cpp index 9c4dfd1ca2..c80cf27bda 100644 --- a/indra/newview/llviewerwearable.cpp +++ b/indra/newview/llviewerwearable.cpp @@ -562,7 +562,7 @@ void LLViewerWearable::saveNewAsset() const  void LLViewerWearable::onSaveNewAssetComplete(const LLUUID& new_asset_id, void* userdata, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed)  {  	LLWearableSaveData* data = (LLWearableSaveData*)userdata; -	const std::string& type_name = LLWearableType::getTypeName(data->mType); +	const std::string& type_name = LLWearableType::getInstance()->getTypeName(data->mType);  	if(0 == status)  	{  		// Success @@ -588,7 +588,7 @@ void LLViewerWearable::onSaveNewAssetComplete(const LLUUID& new_asset_id, void*  std::ostream& operator<<(std::ostream &s, const LLViewerWearable &w)  { -	s << "wearable " << LLWearableType::getTypeName(w.mType) << "\n"; +	s << "wearable " << LLWearableType::getInstance()->getTypeName(w.mType) << "\n";  	s << "    Name: " << w.mName << "\n";  	s << "    Desc: " << w.mDescription << "\n";  	//w.mPermissions diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index f69b9b3861..1a26308b60 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -8952,7 +8952,7 @@ void dump_visual_param(apr_file_t* file, LLVisualParam* viewer_param, F32 value)  	S32 u8_value = F32_to_U8(value,viewer_param->getMinWeight(),viewer_param->getMaxWeight());  	apr_file_printf(file, "\t\t<param id=\"%d\" name=\"%s\" display=\"%s\" value=\"%.3f\" u8=\"%d\" type=\"%s\" wearable=\"%s\" group=\"%d\"/>\n",  					viewer_param->getID(), viewer_param->getName().c_str(), viewer_param->getDisplayName().c_str(), value, u8_value, type_string.c_str(), -					LLWearableType::getTypeName(LLWearableType::EType(wtype)).c_str(), +					LLWearableType::getInstance()->getTypeName(LLWearableType::EType(wtype)).c_str(),  					viewer_param->getGroup());  	} @@ -9730,6 +9730,7 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara  	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);  	if (APR_SUCCESS == outfile.open(fullpath, LL_APR_WB ))  	{ @@ -9746,7 +9747,7 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara  		{  			for (S32 type = LLWearableType::WT_SHAPE; type < LLWearableType::WT_COUNT; type++)  			{ -				const std::string& wearable_name = LLWearableType::getTypeName((LLWearableType::EType)type); +				const std::string& wearable_name = wr_inst->getTypeName((LLWearableType::EType)type);  				apr_file_printf( file, "\n\t\t<!-- wearable: %s -->\n", wearable_name.c_str() );  				for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam()) diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 458d8ced65..6a7bdc7f56 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2030,6 +2030,7 @@ void LLVOAvatarSelf::debugBakedTextureUpload(EBakedTextureIndex index, BOOL fini  const std::string LLVOAvatarSelf::verboseDebugDumpLocalTextureDataInfo(const LLViewerTexLayerSet* layerset) const  {  	std::ostringstream outbuf; +    LLWearableType *wr_inst = LLWearableType::getInstance();  	for (LLAvatarAppearanceDictionary::BakedTextures::const_iterator baked_iter =  			 sAvatarDictionary->getBakedTextures().begin();  		 baked_iter != sAvatarDictionary->getBakedTextures().end(); @@ -2053,7 +2054,7 @@ const std::string LLVOAvatarSelf::verboseDebugDumpLocalTextureDataInfo(const LLV  				{  					for (U32 wearable_index = 0; wearable_index < wearable_count; wearable_index++)  					{ -						outbuf << "    " << LLWearableType::getTypeName(wearable_type) << " " << wearable_index << ":"; +						outbuf << "    " << wr_inst->getTypeName(wearable_type) << " " << wearable_index << ":";  						const LLLocalTextureObject *local_tex_obj = getLocalTextureObject(tex_index, wearable_index);  						if (local_tex_obj)  						{ @@ -2108,6 +2109,7 @@ void LLVOAvatarSelf::dumpAllTextures() const  const std::string LLVOAvatarSelf::debugDumpLocalTextureDataInfo(const LLViewerTexLayerSet* layerset) const  {  	std::string text=""; +    LLWearableType *wr_inst = LLWearableType::getInstance();  	text = llformat("[Final:%d Avail:%d] ",isLocalTextureDataFinal(layerset), isLocalTextureDataAvailable(layerset)); @@ -2131,7 +2133,7 @@ const std::string LLVOAvatarSelf::debugDumpLocalTextureDataInfo(const LLViewerTe  				const U32 wearable_count = gAgentWearables.getWearableCount(wearable_type);  				if (wearable_count > 0)  				{ -					text += LLWearableType::getTypeName(wearable_type) + ":"; +					text += wr_inst->getTypeName(wearable_type) + ":";  					for (U32 wearable_index = 0; wearable_index < wearable_count; wearable_index++)  					{  						const U32 discard_level = getLocalDiscardLevel(tex_index, wearable_index); @@ -2838,9 +2840,10 @@ void LLVOAvatarSelf::dumpWearableInfo(LLAPRFile& outfile)  	apr_file_printf( file, "\n<wearable_info>\n" );  	LLWearableData *wd = getWearableData(); +    LLWearableType *wr_inst = LLWearableType::getInstance();  	for (S32 type = 0; type < LLWearableType::WT_COUNT; type++)  	{ -		const std::string& type_name = LLWearableType::getTypeName((LLWearableType::EType)type); +		const std::string& type_name = wr_inst->getTypeName((LLWearableType::EType)type);  		for (U32 j=0; j< wd->getWearableCount((LLWearableType::EType)type); j++)  		{  			LLViewerWearable *wearable = gAgentWearables.getViewerWearable((LLWearableType::EType)type,j); diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 9acc0f8d2f..bf4db81475 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -820,7 +820,7 @@ void LLWearableItemsList::ContextMenu::show(LLView* spawning_view, LLWearableTyp  	setMenuItemVisible(menup, "wearable_attach_to", false);  	setMenuItemVisible(menup, "wearable_attach_to_hud", false); -	std::string new_label = LLTrans::getString("create_new_" + LLWearableType::getTypeName(w_type)); +	std::string new_label = LLTrans::getString("create_new_" + LLWearableType::getInstance()->getTypeName(w_type));  	LLMenuItemGL* menu_item = menup->getChild<LLMenuItemGL>("create_new");  	menu_item->setLabel(new_label); @@ -1005,7 +1005,7 @@ void LLWearableItemsList::ContextMenu::updateItemsLabels(LLContextMenu* menu)  	if (!item || !item->isWearableType()) return;  	LLWearableType::EType w_type = item->getWearableType(); -	std::string new_label = LLTrans::getString("create_new_" + LLWearableType::getTypeName(w_type)); +	std::string new_label = LLTrans::getString("create_new_" + LLWearableType::getInstance()->getTypeName(w_type));  	LLMenuItemGL* menu_item = menu->getChild<LLMenuItemGL>("create_new");  	menu_item->setLabel(new_label); diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp index b61fbbd073..00f8bace70 100644 --- a/indra/newview/llwearablelist.cpp +++ b/indra/newview/llwearablelist.cpp @@ -241,7 +241,7 @@ LLViewerWearable* LLWearableList::createNewWearable( LLWearableType::EType type,  	LLViewerWearable *wearable = generateNewWearable();  	wearable->setType( type, avatarp ); -	std::string name = LLTrans::getString( LLWearableType::getTypeDefaultNewName(wearable->getType()) ); +	std::string name = LLWearableType::getInstance()->getTypeLabel(wearable->getType());  	wearable->setName( name );  	LLPermissions perm; diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index eda9739976..0f790bf26a 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -807,6 +807,14 @@           function="Inventory.DoToSelected"           parameter="save_as" />      </menu_item_call> +  <menu_item_call + label="Save Selected As" + layout="topleft" + name="Save Selected As"> +    <menu_item_call.on_click +     function="Inventory.DoToSelected" +     parameter="save_selected_as" /> +  </menu_item_call>      <menu_item_separator       layout="topleft"        name="Wearable And Object Separator"/> 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 8794e3bf95..864223e616 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_move.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_move.xml @@ -259,6 +259,15 @@      <combo_box.commit_callback       function="Pref.ClickActionChange"/>    </combo_box> +  <check_box +   control_name="EnableCollisionSounds" +   height="20" +   label="Play sound on collisions" +   layout="topleft" +   left="83" +   name="sound_on_collisions" +   top_pad="10" +   width="200" />    <button     height="23"     label="Other Devices" diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index f9abc8b25d..8d1956957c 100644 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -308,6 +308,10 @@ S32 LLMachineID::getUniqueID(unsigned char *unique_id, size_t len)  	memcpy(unique_id, gMACAddress, len);  	return 1;  } +S32 LLMachineID::getLegacyID(unsigned char *unique_id, size_t len) +{ +    return 0; +}  //-----------------------------------------------------------------------------  // misc  std::string xml_escape_string(const std::string& in) diff --git a/indra/newview/tests/llsechandler_basic_test.cpp b/indra/newview/tests/llsechandler_basic_test.cpp index e5d226a2a4..02185316b2 100644 --- a/indra/newview/tests/llsechandler_basic_test.cpp +++ b/indra/newview/tests/llsechandler_basic_test.cpp @@ -121,6 +121,10 @@ S32 LLMachineID::getUniqueID(unsigned char *unique_id, size_t len)  	memcpy(unique_id, gMACAddress, len);  	return 1;  } +S32 LLMachineID::getLegacyID(unsigned char *unique_id, size_t len) +{ +    return 0; +}  S32 LLMachineID::init() { return 1; } | 
