diff options
Diffstat (limited to 'indra')
37 files changed, 349 insertions, 295 deletions
| diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp index 3a219eb998..ede212181d 100644 --- a/indra/llcommon/llsdserialize.cpp +++ b/indra/llcommon/llsdserialize.cpp @@ -2144,7 +2144,11 @@ bool unzip_llsd(LLSD& data, std::istream& is, S32 size)  	const U32 CHUNK = 65536; -	U8 *in = new U8[size]; +	U8 *in = new(std::nothrow) U8[size]; +	if (!in) +	{ +		return false; +	}  	is.read((char*) in, size);   	U8 out[CHUNK]; @@ -2188,7 +2192,6 @@ bool unzip_llsd(LLSD& data, std::istream& is, S32 size)  		U8* new_result = (U8*)realloc(result, cur_size + have);  		if (new_result == NULL)  		{ -			LL_WARNS() << "Failed to unzip LLSD block: can't reallocate memory, current size: " << cur_size << " bytes; requested " << cur_size + have << " bytes." << LL_ENDL;  			inflateEnd(&strm);  			if (result)  			{ diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 04085eb703..0fa0ef79d9 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -748,7 +748,11 @@ U8* LLImageBase::allocateData(S32 size)  	{  		size = 0;  		mWidth = mHeight = 0; -		mData = NULL; +		if (mData) +		{ +			deleteData(); // virtual +			mData = NULL; +		}  	}  	mDataSize = size;  	claimMem(mDataSize); @@ -775,6 +779,7 @@ U8* LLImageBase::reallocateData(S32 size)  	disclaimMem(mDataSize);  	mDataSize = size;  	claimMem(mDataSize); +	mBadBufferAllocation = false;  	return mData;  } diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp index 57ceb3e11b..e6d2790a5f 100644 --- a/indra/llprimitive/llmaterial.cpp +++ b/indra/llprimitive/llmaterial.cpp @@ -106,10 +106,16 @@ LLMaterial::LLMaterial()  	, mEnvironmentIntensity(LLMaterial::DEFAULT_ENV_INTENSITY)  	, mDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_BLEND)  	, mAlphaMaskCutoff(0) +	, mIsDiffuseAlphaInvalid(false) +	, mIsNormalInvalid(false) +	, mIsSpecularInvalid(false)  {  }  LLMaterial::LLMaterial(const LLSD& material_data) +	: mIsDiffuseAlphaInvalid(false) +	, mIsNormalInvalid(false) +	, mIsSpecularInvalid(false)  {  	fromLLSD(material_data);  } @@ -199,13 +205,17 @@ U32 LLMaterial::getShaderMask(U32 alpha_mode)  	{  		ret = getDiffuseAlphaMode();  	} +	if (mIsDiffuseAlphaInvalid && ret != DIFFUSE_ALPHA_MODE_DEFAULT) +	{ +		ret = alpha_mode != DIFFUSE_ALPHA_MODE_NONE; +	}  	llassert(ret < SHADER_COUNT);  	//next bit is whether or not specular map is present  	const U32 SPEC_BIT = 0x4; -	if (getSpecularID().notNull()) +	if (getSpecularID().notNull() && !mIsSpecularInvalid)  	{  		ret |= SPEC_BIT;  	} @@ -214,7 +224,7 @@ U32 LLMaterial::getShaderMask(U32 alpha_mode)  	//next bit is whether or not normal map is present  	const U32 NORM_BIT = 0x8; -	if (getNormalID().notNull()) +	if (getNormalID().notNull() && !mIsNormalInvalid)  	{  		ret |= NORM_BIT;  	} diff --git a/indra/llprimitive/llmaterial.h b/indra/llprimitive/llmaterial.h index 9f52a3f6c1..2f23a50973 100644 --- a/indra/llprimitive/llmaterial.h +++ b/indra/llprimitive/llmaterial.h @@ -120,6 +120,13 @@ public:  	void		setAlphaMaskCutoff(U8 cutoff) { mAlphaMaskCutoff = cutoff; }  	bool		isNull() const; +	bool		isDiffuseAlphaInvalid() const { return mIsDiffuseAlphaInvalid; } +	void		setDiffuseAlphaInvalid(bool is_invalid) { mIsDiffuseAlphaInvalid = is_invalid; } +	bool		isNormalInvalid() const { return mIsNormalInvalid; } +	void		setNormalInvalid(bool is_invalid) { mIsNormalInvalid = is_invalid; } +	bool		isSpecularInvalid() const { return mIsSpecularInvalid; } +	void		setSpecularInvalid(bool is_invalid) { mIsSpecularInvalid = is_invalid; } +  	static const LLMaterial null;  	bool		operator == (const LLMaterial& rhs) const; @@ -147,6 +154,10 @@ protected:  	U8			mEnvironmentIntensity;  	U8			mDiffuseAlphaMode;  	U8			mAlphaMaskCutoff; + +	bool mIsDiffuseAlphaInvalid; +	bool mIsNormalInvalid; +	bool mIsSpecularInvalid;  };  typedef LLPointer<LLMaterial> LLMaterialPtr; diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 0b4427a31a..2761a90566 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -1921,7 +1921,21 @@ void LLVertexBuffer::unmapBuffer()  					const MappedRegion& region = mMappedVertexRegions[i];  					S32 offset = region.mIndex >= 0 ? mOffsets[region.mType]+sTypeSize[region.mType]*region.mIndex : 0;  					S32 length = sTypeSize[region.mType]*region.mCount; -					glBufferSubDataARB(GL_ARRAY_BUFFER_ARB, offset, length, (U8*) mMappedData+offset); +					if (mSize >= length + offset) +					{ +						glBufferSubDataARB(GL_ARRAY_BUFFER_ARB, offset, length, (U8*)mMappedData + offset); +					} +					else +					{ +						GLint size = 0; +						glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_SIZE_ARB, &size); +						LL_WARNS() << "Attempted to map regions to a buffer that is too small, "  +							<< "mapped size: " << mSize +							<< ", gl buffer size: " << size +							<< ", length: " << length +							<< ", offset: " << offset +							<< LL_ENDL; +					}  					stop_glerror();  				} @@ -1989,7 +2003,21 @@ void LLVertexBuffer::unmapBuffer()  					const MappedRegion& region = mMappedIndexRegions[i];  					S32 offset = region.mIndex >= 0 ? sizeof(U16)*region.mIndex : 0;  					S32 length = sizeof(U16)*region.mCount; -					glBufferSubDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length, (U8*) mMappedIndexData+offset); +					if (mIndicesSize >= length + offset) +					{ +						glBufferSubDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length, (U8*) mMappedIndexData+offset); +					} +					else +					{ +						GLint size = 0; +						glGetBufferParameterivARB(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_BUFFER_SIZE_ARB, &size); +						LL_WARNS() << "Attempted to map regions to a buffer that is too small, "  +							<< "mapped size: " << mIndicesSize +							<< ", gl buffer size: " << size +							<< ", length: " << length +							<< ", offset: " << offset +							<< LL_ENDL; +					}  					stop_glerror();  				} diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index a4243ebfa1..a4dc5bcde1 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -190,31 +190,32 @@ bool LLUrlEntryBase::isWikiLinkCorrect(std::string url)  std::string LLUrlEntryBase::urlToLabelWithGreyQuery(const std::string &url) const  { -	LLUriParser up(unescapeUrl(url)); +	LLUriParser up(escapeUrl(url));  	up.normalize();  	std::string label;  	up.extractParts();  	up.glueFirst(label); -	return label; +	return unescapeUrl(label);  }  std::string LLUrlEntryBase::urlToGreyQuery(const std::string &url) const  { -	LLUriParser up(unescapeUrl(url)); +	std::string escaped_url = escapeUrl(url); +	LLUriParser up(escaped_url);  	std::string label;  	up.extractParts();  	up.glueFirst(label, false); -	size_t pos = url.find(label); +	size_t pos = escaped_url.find(label);  	if (pos == std::string::npos)  	{  		return "";  	}  	pos += label.size(); -	return url.substr(pos); +	return unescapeUrl(escaped_url.substr(pos));  } diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index fa6593267a..ba6fa1e2e9 100644 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -212,7 +212,7 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL  			}  		}  	} -	 +  	// did we find a match? if so, return its details in the match object  	if (match_entry)  	{ @@ -223,33 +223,6 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL  		// fill in the LLUrlMatch object and return it  		std::string url = text.substr(match_start, match_end - match_start + 1); -		LLUrlEntryBase *stripped_entry = NULL; -		if((match_entry != mUrlEntryNoLink) && (match_entry != mUrlEntryHTTPLabel) && (match_entry !=mUrlEntrySLLabel) -		        && LLStringUtil::containsNonprintable(url)) -		{ -			LLStringUtil::stripNonprintable(url); - -			std::vector<LLUrlEntryBase *>::iterator iter; -			for (iter = mUrlEntry.begin(); iter != mUrlEntry.end(); ++iter) -			{ -				LLUrlEntryBase *url_entry = *iter; -				U32 start = 0, end = 0; -				if (matchRegex(url.c_str(), url_entry->getPattern(), start, end)) -				{ -					if (mLLUrlEntryInvalidSLURL == *iter) -					{ -						if(url_entry && url_entry->isSLURLvalid(url)) -						{ -							continue; -						} -					} -					stripped_entry = url_entry; -					break; -				} -			} -		} - -  		if (match_entry == mUrlEntryTrusted)  		{  			LLUriParser up(url); @@ -257,12 +230,10 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL  			url = up.normalizedUri();  		} -		std::string url_label = stripped_entry? stripped_entry->getLabel(url, cb) : match_entry->getLabel(url, cb); -		std::string url_query = stripped_entry? stripped_entry->getQuery(url) : match_entry->getQuery(url);  		match.setValues(match_start, match_end,  						match_entry->getUrl(url), -						url_label, -						url_query, +						match_entry->getLabel(url, cb), +						match_entry->getQuery(url),  						match_entry->getTooltip(url),  						match_entry->getIcon(url),  						match_entry->getStyle(), diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index b5ed53fd4f..62179e4d80 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -421,6 +421,11 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,  	mKeyVirtualKey = 0;  	mhDC = NULL;  	mhRC = NULL; +	 +	if (!SystemParametersInfo(SPI_GETMOUSEVANISH, 0, &mMouseVanish, 0)) +	{ +		mMouseVanish = TRUE; +	}  	// Initialize the keyboard  	gKeyboard = new LLKeyboardWin32(); @@ -1680,7 +1685,7 @@ void LLWindowWin32::showCursorFromMouseMove()  void LLWindowWin32::hideCursorUntilMouseMove()  { -	if (!mHideCursorPermanent) +	if (!mHideCursorPermanent && mMouseVanish)  	{  		hideCursor();  		mHideCursorPermanent = FALSE; @@ -2668,6 +2673,18 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_  			return 0;			  			break; + +		case WM_SETTINGCHANGE: +			{ +				if (w_param == SPI_SETMOUSEVANISH) +				{ +					if (!SystemParametersInfo(SPI_GETMOUSEVANISH, 0, &window_imp->mMouseVanish, 0)) +					{ +						window_imp->mMouseVanish = TRUE; +					} +				} +			} +			break;  		}  	window_imp->mCallbacks->handlePauseWatchdog(window_imp);	 diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index 39ef9b31a4..cd6e5e4fa8 100644 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -214,6 +214,8 @@ protected:  	U32				mRawWParam;  	U32				mRawLParam; +	BOOL			mMouseVanish; +  	friend class LLWindowManager;  }; diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 8128790eb6..97dda072e7 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -1818,7 +1818,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)  				F32 env = mat->getEnvironmentIntensity()/255.f; -				if (mat->getSpecularID().isNull()) +				if (mat->getSpecularID().isNull() || mat->isSpecularInvalid())  				{  					env = te->getShiny()*0.25f;  					col.set(env,env,env,0); @@ -1831,7 +1831,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow)  				sVertexProgram->uniform4f(LLShaderMgr::SPECULAR_COLOR, col.mV[0], col.mV[1], col.mV[2], spec);  				sVertexProgram->uniform1f(LLShaderMgr::ENVIRONMENT_INTENSITY, env); -				if (mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK) +				if (mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK && !mat->isDiffuseAlphaInvalid())  				{  					sVertexProgram->setMinimumAlpha(mat->getAlphaMaskCutoff()/255.f);  				} diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 3d5e2d356e..d502e686c7 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1084,7 +1084,7 @@ bool LLFace::canRenderAsMask()  	}  	LLMaterial* mat = te->getMaterialParams(); -	if (mat && mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND) +	if (mat && !mat->isDiffuseAlphaInvalid() && mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND)  	{  		return false;  	} @@ -1318,14 +1318,14 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,  			if (LLPipeline::sRenderDeferred)  			{ //store shiny in alpha if we don't have a specular map -				if  (!mat || mat->getSpecularID().isNull()) +				if  (!mat || mat->getSpecularID().isNull() || mat->isSpecularInvalid())  				{  					shiny_in_alpha = true;  				}  			}  			else  			{ -				if (!mat || mat->getDiffuseAlphaMode() != LLMaterial::DIFFUSE_ALPHA_MODE_MASK) +				if (!mat || mat->getDiffuseAlphaMode() != LLMaterial::DIFFUSE_ALPHA_MODE_MASK || mat->isDiffuseAlphaInvalid())  				{  					shiny_in_alpha = true;  				} @@ -1811,7 +1811,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,  				std::vector<LLVector2> bump_tc; -				if (mat && !mat->getNormalID().isNull()) +				if (mat && !(mat->getNormalID().isNull() || mat->isNormalInvalid()))  				{ //writing out normal and specular texture coordinates, not bump offsets  					do_bump = false;  				} diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index 7e92643b93..125a823e58 100644 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -341,7 +341,7 @@ BOOL LLFilePicker::getMultipleOpenFiles(ELoadFilter filter)  					dirname = filename + "\\";  				else  					mFiles.push_back(dirname + filename); -				tptrw += filename.size(); +				tptrw += wcslen(tptrw);  			}  		}  	} diff --git a/indra/newview/llfloateravatarrendersettings.cpp b/indra/newview/llfloateravatarrendersettings.cpp index 8bdb70a20d..b8f854feb3 100644 --- a/indra/newview/llfloateravatarrendersettings.cpp +++ b/indra/newview/llfloateravatarrendersettings.cpp @@ -89,20 +89,11 @@ BOOL LLFloaterAvatarRenderSettings::postBuild()      LLFloater::postBuild();      mAvatarSettingsList = getChild<LLNameListCtrl>("render_settings_list");      mAvatarSettingsList->setRightMouseDownCallback(boost::bind(&LLFloaterAvatarRenderSettings::onAvatarListRightClick, this, _1, _2, _3)); -    this->setVisibleCallback(boost::bind(&LLFloaterAvatarRenderSettings::removePicker, this));      getChild<LLFilterEditor>("people_filter_input")->setCommitCallback(boost::bind(&LLFloaterAvatarRenderSettings::onFilterEdit, this, _2));  	return TRUE;  } -void LLFloaterAvatarRenderSettings::removePicker() -{ -    if(mPicker.get()) -    { -        mPicker.get()->closeFloater(); -    } -} -  void LLFloaterAvatarRenderSettings::draw()  {      if(mNeedsUpdate) @@ -263,8 +254,6 @@ void LLFloaterAvatarRenderSettings::onClickAdd(const LLSD& userdata)      {          root_floater->addDependentFloater(picker);      } - -    mPicker = picker->getHandle();  }  void LLFloaterAvatarRenderSettings::callbackAvatarPicked(const uuid_vec_t& ids, S32 visual_setting) diff --git a/indra/newview/llfloateravatarrendersettings.h b/indra/newview/llfloateravatarrendersettings.h index 6790b24b90..00ee074f17 100644 --- a/indra/newview/llfloateravatarrendersettings.h +++ b/indra/newview/llfloateravatarrendersettings.h @@ -66,7 +66,6 @@ private:      bool mNeedsUpdate;      LLListContextMenu* mContextMenu;      LLNameListCtrl* mAvatarSettingsList; -    LLHandle<LLFloater> mPicker;      std::string mNameFilter;  }; diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 5222637039..5de7ca5289 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1304,7 +1304,6 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState()  	BOOL shaders = ctrl_shader_enable->get();  	if (shaders)  	{ -		terrain_detail->setValue(1);  		terrain_detail->setEnabled(FALSE);  		terrain_text->setEnabled(FALSE);  	} diff --git a/indra/newview/llfloatertwitter.cpp b/indra/newview/llfloatertwitter.cpp index 4bab89ace2..803c80ac1a 100644 --- a/indra/newview/llfloatertwitter.cpp +++ b/indra/newview/llfloatertwitter.cpp @@ -404,13 +404,12 @@ void LLTwitterPhotoPanel::clearAndClose()  void LLTwitterPhotoPanel::updateStatusTextLength(BOOL restore_old_status_text)  {  	bool add_location = mLocationCheckbox->getValue().asBoolean(); -	bool add_photo = mPhotoCheckbox->getValue().asBoolean();  	// Restrict the status text length to Twitter's character limit  	LLTextEditor* status_text_box = dynamic_cast<LLTextEditor*>(mStatusTextBox);  	if (status_text_box)  	{ -		int max_status_length = 140 - (add_location ? 40 : 0) - (add_photo ? 40 : 0); +		int max_status_length = 280 - (add_location ? 40 : 0);  		status_text_box->setMaxTextLength(max_status_length);  		if (restore_old_status_text)  		{ diff --git a/indra/newview/llinspectgroup.cpp b/indra/newview/llinspectgroup.cpp index a4fce36783..8332443162 100644 --- a/indra/newview/llinspectgroup.cpp +++ b/indra/newview/llinspectgroup.cpp @@ -205,7 +205,7 @@ void LLInspectGroup::nameUpdatedCallback(  {  	if (id == mGroupID)  	{ -		getChild<LLUICtrl>("group_name")->setValue( LLSD(name) ); +		getChild<LLUICtrl>("group_name")->setValue(LLSD("<nolink>" + name + "</nolink>"));  	}  	// Otherwise possibly a request for an older inspector, ignore it diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 904bc29929..4d1a6451e5 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -43,6 +43,7 @@  #include "llfloatermarketplacelistings.h"  #include "llfloateroutfitphotopreview.h"  #include "llfloatersidepanelcontainer.h" +#include "llsidepanelinventory.h"  #include "llfloaterworldmap.h"  #include "llfolderview.h"  #include "llfriendcard.h" @@ -1828,11 +1829,24 @@ void LLItemBridge::gotoItem()  	LLInventoryObject *obj = getInventoryObject();  	if (obj && obj->getIsLinkType())  	{ -		LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); -		if (active_panel) +		const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX); +		if (gInventory.isObjectDescendentOf(obj->getLinkedUUID(), inbox_id))  		{ -			active_panel->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO); +			LLSidepanelInventory *sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory"); +			if (sidepanel_inventory && sidepanel_inventory->getInboxPanel()) +			{ +				sidepanel_inventory->getInboxPanel()->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO); +			} +		} +		else +		{ +			LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(); +			if (active_panel) +			{ +				active_panel->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO); +			}  		} +  	}  } diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index d610b920b9..6e7f62d84a 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -1367,7 +1367,9 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open)  void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL main_panel)  {  	LLInventoryPanel *active_panel; -	if (main_panel) +	bool in_inbox = (gInventory.isObjectDescendentOf(obj_id, gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX))); + +	if (main_panel && !in_inbox)  	{  		LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory")->selectAllItemsPanel();  	} @@ -1376,38 +1378,13 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L  	if (active_panel)  	{  		LL_DEBUGS("Messaging") << "Highlighting" << obj_id  << LL_ENDL; -		 -		LLViewerInventoryItem * item = gInventory.getItem(obj_id); -		LLViewerInventoryCategory * cat = gInventory.getCategory(obj_id); -		 -		bool in_inbox = false; -		 -		LLViewerInventoryCategory * parent_cat = NULL; -		 -		if (item) -		{ -			parent_cat = gInventory.getCategory(item->getParentUUID()); -		} -		else if (cat) -		{ -			parent_cat = gInventory.getCategory(cat->getParentUUID()); -		} -		 -		if (parent_cat) -		{ -			in_inbox = (LLFolderType::FT_INBOX == parent_cat->getPreferredType()); -		} -		 +  		if (in_inbox)  		{  			LLSidepanelInventory * sidepanel_inventory =	LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");  			LLInventoryPanel * inventory_panel = NULL; -			 -			if (in_inbox) -			{ -				sidepanel_inventory->openInbox(); -				inventory_panel = sidepanel_inventory->getInboxPanel(); -			} +			sidepanel_inventory->openInbox(); +			inventory_panel = sidepanel_inventory->getInboxPanel();  			if (inventory_panel)  			{ diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index df708013fc..850a25107f 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -2918,9 +2918,12 @@ void LLMeshHandlerBase::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRespo  			// handler, optional first that takes a body, fallback second  			// that requires a temporary allocation and data copy.  			body_offset = mOffset - offset; -			data = new U8[data_size - body_offset]; -			body->read(body_offset, (char *) data, data_size - body_offset); -			LLMeshRepository::sBytesReceived += data_size; +			data = new(std::nothrow) U8[data_size - body_offset]; +			if (data) +			{ +				body->read(body_offset, (char *) data, data_size - body_offset); +				LLMeshRepository::sBytesReceived += data_size; +			}  		}  		processData(body, body_offset, data, data_size - body_offset); @@ -2969,7 +2972,9 @@ void LLMeshHeaderHandler::processData(LLCore::BufferArray * /* body */, S32 /* b  									  U8 * data, S32 data_size)  {  	LLUUID mesh_id = mMeshParams.getSculptID(); -	bool success = (! MESH_HEADER_PROCESS_FAILED) && gMeshRepo.mThread->headerReceived(mMeshParams, data, data_size); +	bool success = (! MESH_HEADER_PROCESS_FAILED) +		&& ((data != NULL) == (data_size > 0)) // if we have data but no size or have size but no data, something is wrong +		&& gMeshRepo.mThread->headerReceived(mMeshParams, data, data_size);  	llassert(success);  	if (! success)  	{ @@ -3093,7 +3098,9 @@ void LLMeshLODHandler::processFailure(LLCore::HttpStatus status)  void LLMeshLODHandler::processData(LLCore::BufferArray * /* body */, S32 /* body_offset */,  								   U8 * data, S32 data_size)  { -	if ((! MESH_LOD_PROCESS_FAILED) && gMeshRepo.mThread->lodReceived(mMeshParams, mLOD, data, data_size)) +	if ((!MESH_LOD_PROCESS_FAILED) +		&& ((data != NULL) == (data_size > 0)) // if we have data but no size or have size but no data, something is wrong +		&& gMeshRepo.mThread->lodReceived(mMeshParams, mLOD, data, data_size))  	{  		// good fetch from sim, write to VFS for caching  		LLVFile file(gVFS, mMeshParams.getSculptID(), LLAssetType::AT_MESH, LLVFile::WRITE); @@ -3141,7 +3148,9 @@ void LLMeshSkinInfoHandler::processFailure(LLCore::HttpStatus status)  void LLMeshSkinInfoHandler::processData(LLCore::BufferArray * /* body */, S32 /* body_offset */,  										U8 * data, S32 data_size)  { -	if ((! MESH_SKIN_INFO_PROCESS_FAILED) && gMeshRepo.mThread->skinInfoReceived(mMeshID, data, data_size)) +	if ((!MESH_SKIN_INFO_PROCESS_FAILED) +		&& ((data != NULL) == (data_size > 0)) // if we have data but no size or have size but no data, something is wrong +		&& gMeshRepo.mThread->skinInfoReceived(mMeshID, data, data_size))  	{  		// good fetch from sim, write to VFS for caching  		LLVFile file(gVFS, mMeshID, LLAssetType::AT_MESH, LLVFile::WRITE); @@ -3187,7 +3196,9 @@ void LLMeshDecompositionHandler::processFailure(LLCore::HttpStatus status)  void LLMeshDecompositionHandler::processData(LLCore::BufferArray * /* body */, S32 /* body_offset */,  											 U8 * data, S32 data_size)  { -	if ((! MESH_DECOMP_PROCESS_FAILED) && gMeshRepo.mThread->decompositionReceived(mMeshID, data, data_size)) +	if ((!MESH_DECOMP_PROCESS_FAILED) +		&& ((data != NULL) == (data_size > 0)) // if we have data but no size or have size but no data, something is wrong +		&& gMeshRepo.mThread->decompositionReceived(mMeshID, data, data_size))  	{  		// good fetch from sim, write to VFS for caching  		LLVFile file(gVFS, mMeshID, LLAssetType::AT_MESH, LLVFile::WRITE); @@ -3232,7 +3243,9 @@ void LLMeshPhysicsShapeHandler::processFailure(LLCore::HttpStatus status)  void LLMeshPhysicsShapeHandler::processData(LLCore::BufferArray * /* body */, S32 /* body_offset */,  											U8 * data, S32 data_size)  { -	if ((! MESH_PHYS_SHAPE_PROCESS_FAILED) && gMeshRepo.mThread->physicsShapeReceived(mMeshID, data, data_size)) +	if ((!MESH_PHYS_SHAPE_PROCESS_FAILED) +		&& ((data != NULL) == (data_size > 0)) // if we have data but no size or have size but no data, something is wrong +		&& gMeshRepo.mThread->physicsShapeReceived(mMeshID, data, data_size))  	{  		// good fetch from sim, write to VFS for caching  		LLVFile file(gVFS, mMeshID, LLAssetType::AT_MESH, LLVFile::WRITE); diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index bf1716e18c..64df449c26 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -316,14 +316,7 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags)  				updateAdd(localmute);  				notifyObservers();  				notifyObserversDetailed(localmute); -				if(!(localmute.mFlags & LLMute::flagParticles)) -				{ -					//Kill all particle systems owned by muted task -					if(localmute.mType == LLMute::AGENT || localmute.mType == LLMute::OBJECT) -					{ -						LLViewerPartSim::getInstance()->clearParticlesByOwnerID(localmute.mID); -					} -				} +  				//mute local lights that are attached to the avatar  				LLVOAvatar *avatarp = find_avatar(localmute.mID);  				if (avatarp) diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index ec80ff8de7..b004226bd5 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -44,6 +44,7 @@  #include "llfloaterreg.h"  #include "llmenubutton.h"  #include "lloutfitobserver.h" +#include "llpanelmarketplaceinbox.h"  #include "llpreviewtexture.h"  #include "llresmgr.h"  #include "llscrollcontainer.h" @@ -178,7 +179,9 @@ BOOL LLPanelMainInventory::postBuild()  		mWornItemsPanel->setFilterWorn();  		mWornItemsPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);  		mWornItemsPanel->setFilterLinks(LLInventoryFilter::FILTERLINK_EXCLUDE_LINKS); -		mWornItemsPanel->getFilter().markDefault(); +		LLInventoryFilter& worn_filter = mWornItemsPanel->getFilter(); +		worn_filter.setFilterCategoryTypes(worn_filter.getFilterCategoryTypes() | (1ULL << LLFolderType::FT_INBOX)); +		worn_filter.markDefault();  		mWornItemsPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mWornItemsPanel, _1, _2));  	}  	mSearchTypeCombo  = getChild<LLComboBox>("search_type"); @@ -483,7 +486,7 @@ void LLPanelMainInventory::onClearSearch()  	if (mActivePanel && (getActivePanel() != mWornItemsPanel))  	{  		initially_active = mActivePanel->getFilter().isNotDefault(); -		mActivePanel->setFilterSubString(LLStringUtil::null); +		setFilterSubString(LLStringUtil::null);  		mActivePanel->setFilterTypes(0xffffffffffffffffULL);  		mActivePanel->setFilterLinks(LLInventoryFilter::FILTERLINK_INCLUDE_LINKS);  	} @@ -503,6 +506,16 @@ void LLPanelMainInventory::onClearSearch()  		mActivePanel->getRootFolder()->scrollToShowSelection();  	}  	mFilterSubString = ""; + +	LLSidepanelInventory * sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory"); +	if (sidepanel_inventory) +	{ +		LLPanelMarketplaceInbox* inbox_panel = sidepanel_inventory->getChild<LLPanelMarketplaceInbox>("marketplace_inbox"); +		if (inbox_panel) +		{ +			inbox_panel->onClearSearch(); +		} +	}  }  void LLPanelMainInventory::onFilterEdit(const std::string& search_string ) @@ -534,6 +547,16 @@ void LLPanelMainInventory::onFilterEdit(const std::string& search_string )  	// set new filter string  	setFilterSubString(mFilterSubString); + +	LLSidepanelInventory * sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory"); +	if (sidepanel_inventory) +	{ +		LLPanelMarketplaceInbox* inbox_panel = sidepanel_inventory->getChild<LLPanelMarketplaceInbox>("marketplace_inbox"); +		if (inbox_panel) +		{ +			inbox_panel->onFilterEdit(search_string); +		} +	}  } @@ -848,7 +871,6 @@ void LLFloaterInventoryFinder::updateElementsFromFilter()  	// Get data needed for filter display  	U32 filter_types = mFilter->getFilterObjectTypes(); -	std::string filter_string = mFilter->getFilterSubString();  	LLInventoryFilter::EFolderShow show_folders = mFilter->getShowFolderState();  	U32 hours = mFilter->getHoursAgo();  	U32 date_search_direction = mFilter->getDateSearchDirection(); diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index 79e079f6bd..8a86f4f63d 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -51,11 +51,15 @@ LLPanelMarketplaceInbox::LLPanelMarketplaceInbox(const Params& p)  	, mFreshCountCtrl(NULL)  	, mInboxButton(NULL)  	, mInventoryPanel(NULL) +	, mSavedFolderState(NULL)  { +	mSavedFolderState = new LLSaveFolderState(); +	mSavedFolderState->setApply(FALSE);  }  LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox()  { +	delete mSavedFolderState;  }  // virtual @@ -96,6 +100,7 @@ LLInventoryPanel * LLPanelMarketplaceInbox::setupInventoryPanel()  	// Set the sort order newest to oldest  	mInventoryPanel->getFolderViewModel()->setSorter(LLInventoryFilter::SO_DATE);  	mInventoryPanel->getFilter().markDefault(); +	mInventoryPanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);  	// Set selection callback for proper update of inventory status buttons  	mInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceInbox::onSelectionChange, this)); @@ -193,6 +198,38 @@ U32 LLPanelMarketplaceInbox::getTotalItemCount() const  	return item_count;  } +void LLPanelMarketplaceInbox::onClearSearch() +{ +	if (mInventoryPanel) +	{ +		mInventoryPanel->setFilterSubString(LLStringUtil::null); +		mSavedFolderState->setApply(TRUE); +		mInventoryPanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState); +		LLOpenFoldersWithSelection opener; +		mInventoryPanel->getRootFolder()->applyFunctorRecursively(opener); +		mInventoryPanel->getRootFolder()->scrollToShowSelection(); +	} +} + +void LLPanelMarketplaceInbox::onFilterEdit(const std::string& search_string) +{ +	if (mInventoryPanel) +	{ + +		if (search_string == "") +		{ +			onClearSearch(); +		} + +		if (!mInventoryPanel->getFilter().isNotDefault()) +		{ +			mSavedFolderState->setApply(FALSE); +			mInventoryPanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState); +		} +		mInventoryPanel->setFilterSubString(search_string); +	} +} +  std::string LLPanelMarketplaceInbox::getBadgeString() const  {  	std::string item_count_str(""); diff --git a/indra/newview/llpanelmarketplaceinbox.h b/indra/newview/llpanelmarketplaceinbox.h index 9eb74581a2..952e3a333a 100644 --- a/indra/newview/llpanelmarketplaceinbox.h +++ b/indra/newview/llpanelmarketplaceinbox.h @@ -28,7 +28,7 @@  #define LL_LLPANELMARKETPLACEINBOX_H  #include "llpanel.h" - +#include "llfolderview.h"  class LLButton;  class LLInventoryPanel;  class LLUICtrl; @@ -56,6 +56,9 @@ public:  	LLInventoryPanel * setupInventoryPanel(); +	void onClearSearch(); +	void onFilterEdit(const std::string& search_string); +  	U32 getFreshItemCount() const;  	U32 getTotalItemCount() const; @@ -71,6 +74,7 @@ private:  	LLUICtrl *			mFreshCountCtrl;  	LLButton *			mInboxButton;  	LLInventoryPanel *	mInventoryPanel; +	LLSaveFolderState*			mSavedFolderState;  }; diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp index c5fda3c136..e08670eff3 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp @@ -62,6 +62,12 @@ LLInboxInventoryPanel::LLInboxInventoryPanel(const LLInboxInventoryPanel::Params  LLInboxInventoryPanel::~LLInboxInventoryPanel()  {} +void LLInboxInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) +{ +	LLInventoryPanel::initFromParams(params); +	getFilter().setFilterCategoryTypes(getFilter().getFilterCategoryTypes() | (1ULL << LLFolderType::FT_INBOX)); +} +  LLFolderViewFolder * LLInboxInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop)  {  	LLUIColor item_color = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); diff --git a/indra/newview/llpanelmarketplaceinboxinventory.h b/indra/newview/llpanelmarketplaceinboxinventory.h index 66aafe83d1..b1335e2d71 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.h +++ b/indra/newview/llpanelmarketplaceinboxinventory.h @@ -46,6 +46,7 @@ public:  	~LLInboxInventoryPanel();  	// virtual +	void initFromParams(const LLInventoryPanel::Params&);  	LLFolderViewFolder*	createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop);  	LLFolderViewItem * createFolderViewItem(LLInvFVBridge * bridge);  }; diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp index 15d39c231f..69f5dd1914 100644 --- a/indra/newview/llphysicsmotion.cpp +++ b/indra/newview/llphysicsmotion.cpp @@ -491,12 +491,6 @@ BOOL LLPhysicsMotion::onUpdate(F32 time)          //          const F32 time_delta = time - mLastTime; - -	// Don't update too frequently, to avoid precision errors from small time slices. -	if (time_delta <= .01) -	{ -		return FALSE; -	}  	// If less than 1FPS, we don't want to be spending time updating physics at all.          if (time_delta > 1.0) diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 01b0dd0077..7c6cce5c58 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -791,6 +791,14 @@ void LLViewerMedia::updateMedia(void *dummy_arg)  					LLViewerAudio::getInstance()->stopInternetStreamWithAutoFade();  				}  			} +            else +            { +                if(gAudiop && LLViewerMedia::hasParcelAudio() && gSavedSettings.getBOOL("MediaTentativeAutoPlay")) +                { +                    LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLViewerMedia::getParcelAudioURL()); +                } +            } +  			pimpl->setPriority(new_priority);  			if(pimpl->getUsedInUI()) diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 5de4029542..e86d39e9d0 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -270,7 +270,9 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe  	mPhysicsShapeUnknown(true),  	mAttachmentItemID(LLUUID::null),  	mLastUpdateType(OUT_UNKNOWN), -	mLastUpdateCached(FALSE) +	mLastUpdateCached(FALSE), +	mCachedMuteListUpdateTime(0), +	mCachedOwnerInMuteList(false)  {  	if (!is_global)  	{ @@ -5116,6 +5118,29 @@ void LLViewerObject::updateText()  	}  } +bool LLViewerObject::isOwnerInMuteList() +{ +	if (isAvatar() || mOwnerID.isNull()) +	{ +		return false; +	} +	bool muted = false; +	F64 now = LLFrameTimer::getTotalSeconds(); +	if (now < mCachedMuteListUpdateTime) +	{ +		muted = mCachedOwnerInMuteList; +	} +	else +	{ +		muted = LLMuteList::getInstance()->isMuted(mOwnerID); + +		const F64 SECONDS_BETWEEN_MUTE_UPDATES = 1; +		mCachedMuteListUpdateTime = now + SECONDS_BETWEEN_MUTE_UPDATES; +		mCachedOwnerInMuteList = muted; +	} +	return muted; +} +  LLVOAvatar* LLViewerObject::asAvatar()  {  	return NULL; diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 7a490f6957..4f826b9eac 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -422,6 +422,8 @@ public:  	void updateText(); // update text label position  	virtual void updateDrawable(BOOL force_damped); // force updates on static objects +	bool isOwnerInMuteList(); +  	void setDrawableState(U32 state, BOOL recursive = TRUE);  	void clearDrawableState(U32 state, BOOL recursive = TRUE);  	BOOL isDrawableState(U32 state, BOOL recursive = TRUE) const; @@ -823,6 +825,9 @@ private:  	static BOOL sVelocityInterpolate;  	static BOOL sPingInterpolate; +	bool mCachedOwnerInMuteList; +	F64 mCachedMuteListUpdateTime; +  	//--------------------------------------------------------------------  	// For objects that are attachments  	//-------------------------------------------------------------------- diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp index b4617566ac..e8ea0eb26d 100644 --- a/indra/newview/llviewerpartsim.cpp +++ b/indra/newview/llviewerpartsim.cpp @@ -37,6 +37,7 @@  #include "llviewerregion.h"  #include "llvopartgroup.h"  #include "llworld.h" +#include "llmutelist.h"  #include "pipeline.h"  #include "llspatialpartition.h"  #include "llvoavatarself.h" @@ -711,6 +712,11 @@ void LLViewerPartSim::updateSimulation()  				upd = FALSE;  			} +			if(vobj && vobj->isOwnerInMuteList()) +			{ +				upd = FALSE; +			} +  			if (upd && vobj && (vobj->getPCode() == LL_PCODE_VOLUME))  			{  				if(vobj->getAvatar() && vobj->getAvatar()->isTooComplex()) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 7b4895b862..364de1d810 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1405,11 +1405,6 @@ BOOL LLViewerWindow::handleTranslatedKeyDown(KEY key,  MASK mask, BOOL repeated)  	// Let the voice chat code check for its PTT key.  Note that this never affects event processing.  	LLVoiceClient::getInstance()->keyDown(key, mask); -	if (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME) -	{ -		gAgent.clearAFK(); -	} -  	// *NOTE: We want to interpret KEY_RETURN later when it arrives as  	// a Unicode char, not as a keydown.  Otherwise when client frame  	// rate is really low, hitting return sends your chat text before @@ -1423,7 +1418,13 @@ BOOL LLViewerWindow::handleTranslatedKeyDown(KEY key,  MASK mask, BOOL repeated)      		return FALSE;  	} -	return gViewerKeyboard.handleKey(key, mask, repeated); +	BOOL handled = gViewerKeyboard.handleKey(key, mask, repeated); +	if (!handled || (gAwayTimer.getElapsedTimeF32() > LLAgent::MIN_AFK_TIME)) +	{ +		gAgent.clearAFK(); +	} + +	return handled;  }  BOOL LLViewerWindow::handleTranslatedKeyUp(KEY key,  MASK mask) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index f77b48ff80..206d34d7ea 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2052,134 +2052,81 @@ S32 LLVOVolume::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID)  }  bool LLVOVolume::notifyAboutCreatingTexture(LLViewerTexture *texture) -{ //Ok, here we have confirmation about texture creation, check our wait-list -  //and make changes, or return false +{ +	// Texture was created, process it and remove from wait list  	std::pair<mmap_UUID_MAP_t::iterator, mmap_UUID_MAP_t::iterator> range = mWaitingTextureInfo.equal_range(texture->getID()); +	if(range.first == range.second) return false; -	typedef std::map<U8, LLMaterialPtr> map_te_material; -	map_te_material new_material; +	bool needs_update = false;  	for(mmap_UUID_MAP_t::iterator range_it = range.first; range_it != range.second; ++range_it)  	{  		LLMaterialPtr cur_material = getTEMaterialParams(range_it->second.te); +		if (cur_material.isNull()) +		{ +			continue; +		} -		//here we just interesting in DIFFUSE_MAP only! -		if(NULL != cur_material.get() && LLRender::DIFFUSE_MAP == range_it->second.map && GL_RGBA != texture->getPrimaryFormat()) -		{ //ok let's check the diffuse mode -			switch(cur_material->getDiffuseAlphaMode()) -			{ -			case LLMaterial::DIFFUSE_ALPHA_MODE_BLEND: -			case LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE: -			case LLMaterial::DIFFUSE_ALPHA_MODE_MASK: -				{ //uups... we have non 32 bit texture with LLMaterial::DIFFUSE_ALPHA_MODE_* => LLMaterial::DIFFUSE_ALPHA_MODE_NONE - -					LLMaterialPtr mat = NULL; -					map_te_material::iterator it = new_material.find(range_it->second.te); -					if(new_material.end() == it) { -						mat = new LLMaterial(cur_material->asLLSD()); -						new_material.insert(map_te_material::value_type(range_it->second.te, mat)); -					} else { -						mat = it->second; -					} - -					mat->setDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_NONE); - -				} break; -			} //switch -		} //if -	} //for +		if (LLRender::DIFFUSE_MAP == range_it->second.map +			&& GL_RGBA != texture->getPrimaryFormat() +			&& cur_material->getDiffuseAlphaMode() != LLMaterial::DIFFUSE_ALPHA_MODE_NONE +			&& cur_material->getDiffuseAlphaMode() != LLMaterial::DIFFUSE_ALPHA_MODE_DEFAULT) +		{ +			// We have non 32 bit texture with alpha, it is invalid -	//setup new materials -	for(map_te_material::const_iterator it = new_material.begin(), end = new_material.end(); it != end; ++it) -	{ -		LLMaterialMgr::getInstance()->put(getID(), it->first, *it->second); -		LLViewerObject::setTEMaterialParams(it->first, it->second); +			cur_material->setDiffuseAlphaInvalid(true); +			needs_update = true; +		}  	}  	//clear wait-list  	mWaitingTextureInfo.erase(range.first, range.second); -	return 0 != new_material.size(); +	return needs_update;  }  bool LLVOVolume::notifyAboutMissingAsset(LLViewerTexture *texture) -{ //Ok, here if we wait information about texture and it's missing -  //then depending from the texture map (diffuse, normal, or specular) -  //make changes in material and confirm it. If not return false. +{ +	// Texture was marked as missing, process it and remove from wait list +  	std::pair<mmap_UUID_MAP_t::iterator, mmap_UUID_MAP_t::iterator> range = mWaitingTextureInfo.equal_range(texture->getID());  	if(range.first == range.second) return false; - -	typedef std::map<U8, LLMaterialPtr> map_te_material; -	map_te_material new_material;  	for(mmap_UUID_MAP_t::iterator range_it = range.first; range_it != range.second; ++range_it)  	{  		LLMaterialPtr cur_material = getTEMaterialParams(range_it->second.te);  		if (cur_material.isNull()) +		{  			continue; +		} -		switch(range_it->second.map) +		switch (range_it->second.map)  		{  		case LLRender::DIFFUSE_MAP:  			{ -				if(LLMaterial::DIFFUSE_ALPHA_MODE_NONE != cur_material->getDiffuseAlphaMode()) -				{ //missing texture + !LLMaterial::DIFFUSE_ALPHA_MODE_NONE => LLMaterial::DIFFUSE_ALPHA_MODE_NONE -					LLMaterialPtr mat = NULL; -					map_te_material::iterator it = new_material.find(range_it->second.te); -					if(new_material.end() == it) { -						mat = new LLMaterial(cur_material->asLLSD()); -						new_material.insert(map_te_material::value_type(range_it->second.te, mat)); -					} else { -						mat = it->second; -					} - -					mat->setDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_NONE); -				} -			} break; +				cur_material->setDiffuseAlphaInvalid(true); +				break; +			}  		case LLRender::NORMAL_MAP: -			{ //missing texture => reset material texture id -				LLMaterialPtr mat = NULL; -				map_te_material::iterator it = new_material.find(range_it->second.te); -				if(new_material.end() == it) { -					mat = new LLMaterial(cur_material->asLLSD()); -					new_material.insert(map_te_material::value_type(range_it->second.te, mat)); -				} else { -					mat = it->second; -				} - -				mat->setNormalID(LLUUID::null); -			} break; +			{ +				cur_material->setNormalInvalid(true); +				break; +			}  		case LLRender::SPECULAR_MAP: -			{ //missing texture => reset material texture id -				LLMaterialPtr mat = NULL; -				map_te_material::iterator it = new_material.find(range_it->second.te); -				if(new_material.end() == it) { -					mat = new LLMaterial(cur_material->asLLSD()); -					new_material.insert(map_te_material::value_type(range_it->second.te, mat)); -				} else { -					mat = it->second; -				} - -				mat->setSpecularID(LLUUID::null); -			} break; -		case LLRender::NUM_TEXTURE_CHANNELS: -				//nothing to do, make compiler happy +			{ +				cur_material->setSpecularInvalid(true); +				break; +			} +		default:  			break; -		} //switch -	} //for - -	//setup new materials -	for(map_te_material::const_iterator it = new_material.begin(), end = new_material.end(); it != end; ++it) -	{ -		LLMaterialMgr::getInstance()->put(getID(), it->first, *it->second); -		LLViewerObject::setTEMaterialParams(it->first, it->second); +		}  	}  	//clear wait-list  	mWaitingTextureInfo.erase(range.first, range.second); -	return 0 != new_material.size(); +	return true;  }  S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams) @@ -2195,44 +2142,25 @@ S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialPa  		llassert(NULL != img_diffuse); -		LLMaterialPtr new_material = NULL; -  		//diffuse  		if(NULL != img_diffuse) -		{ //guard +		{  			if(0 == img_diffuse->getPrimaryFormat() && !img_diffuse->isMissingAsset()) -			{ //ok here we don't have information about texture, let's belief and leave material settings -			  //but we remember this case +			{ +				// Texture information is missing, wait for it  				mWaitingTextureInfo.insert(mmap_UUID_MAP_t::value_type(img_diffuse->getID(), material_info(LLRender::DIFFUSE_MAP, te)));  			}  			else  			{ -				bool bSetDiffuseNone = false;  				if(img_diffuse->isMissingAsset())  				{ -					bSetDiffuseNone = true; +					pMaterial->setDiffuseAlphaInvalid(true);  				} -				else +				else if (GL_RGBA != img_diffuse->getPrimaryFormat() +						&& pMaterialParams->getDiffuseAlphaMode() != LLMaterial::DIFFUSE_ALPHA_MODE_NONE +						&& pMaterialParams->getDiffuseAlphaMode() != LLMaterial::DIFFUSE_ALPHA_MODE_DEFAULT)  				{ -					switch(pMaterialParams->getDiffuseAlphaMode()) -					{ -					case LLMaterial::DIFFUSE_ALPHA_MODE_BLEND: -					case LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE: -					case LLMaterial::DIFFUSE_ALPHA_MODE_MASK: -						{ //all of them modes available only for 32 bit textures -							if(GL_RGBA != img_diffuse->getPrimaryFormat()) -							{ -								bSetDiffuseNone = true; -							} -						} break; -					} -				} //else - - -				if(bSetDiffuseNone) -				{ //upps... we should substitute this material with LLMaterial::DIFFUSE_ALPHA_MODE_NONE -					new_material = new LLMaterial(pMaterialParams->asLLSD()); -					new_material->setDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_NONE); +					pMaterial->setDiffuseAlphaInvalid(true);  				}  			}  		} @@ -2242,14 +2170,11 @@ S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialPa  		{  			if(img_normal && img_normal->isMissingAsset() && img_normal->getID() == pMaterialParams->getNormalID())  			{ -				if(!new_material) { -					new_material = new LLMaterial(pMaterialParams->asLLSD()); -				} -				new_material->setNormalID(LLUUID::null); +				pMaterial->setNormalInvalid(true);  			}  			else if(NULL == img_normal || 0 == img_normal->getPrimaryFormat()) -			{ //ok here we don't have information about texture, let's belief and leave material settings -				//but we remember this case +			{ +				// Texture information is missing, wait for it  				mWaitingTextureInfo.insert(mmap_UUID_MAP_t::value_type(pMaterialParams->getNormalID(), material_info(LLRender::NORMAL_MAP,te)));  			} @@ -2261,22 +2186,14 @@ S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialPa  		{  			if(img_specular && img_specular->isMissingAsset() && img_specular->getID() == pMaterialParams->getSpecularID())  			{ -				if(!new_material) { -					new_material = new LLMaterial(pMaterialParams->asLLSD()); -				} -				new_material->setSpecularID(LLUUID::null); +				pMaterial->setSpecularInvalid(true);  			}  			else if(NULL == img_specular || 0 == img_specular->getPrimaryFormat()) -			{ //ok here we don't have information about texture, let's belief and leave material settings -				//but we remember this case +			{ +				// Texture information is missing, wait for it  				mWaitingTextureInfo.insert(mmap_UUID_MAP_t::value_type(pMaterialParams->getSpecularID(), material_info(LLRender::SPECULAR_MAP, te)));  			}  		} - -		if(new_material) { -			pMaterial = new_material; -			LLMaterialMgr::getInstance()->put(getID(),te,*pMaterial); -		}  	}  	S32 res = LLViewerObject::setTEMaterialParams(te, pMaterial); @@ -4568,7 +4485,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,  				}  				draw_info->mAlphaMaskCutoff = mat->getAlphaMaskCutoff() * (1.f / 255.f); -				draw_info->mDiffuseAlphaMode = mat->getDiffuseAlphaMode(); +				draw_info->mDiffuseAlphaMode = mat->isDiffuseAlphaInvalid() ? LLMaterial::DIFFUSE_ALPHA_MODE_NONE : mat->getDiffuseAlphaMode();  				draw_info->mNormalMap = facep->getViewerObject()->getTENormalMap(facep->getTEOffset());  		} @@ -4837,11 +4754,14 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)  						}  						LLMaterial* mat = te->getMaterialParams().get(); +						U8 alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE; +						if (mat && !mat->isDiffuseAlphaInvalid()) +						{ +							alpha_mode = mat->getDiffuseAlphaMode(); +						}  						if (mat && LLPipeline::sRenderDeferred)  						{ -							U8 alpha_mode = mat->getDiffuseAlphaMode(); -  							bool is_alpha = type == LLDrawPool::POOL_ALPHA &&  								(alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND ||  								te->getColor().mV[3] < 0.999f); @@ -4861,11 +4781,10 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)  						{  							bool fullbright = te->getFullbright();  							bool is_alpha = type == LLDrawPool::POOL_ALPHA; -							U8 mode = mat->getDiffuseAlphaMode(); -							bool can_be_shiny = mode == LLMaterial::DIFFUSE_ALPHA_MODE_NONE || -												mode == LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE; +							bool can_be_shiny = alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_NONE || +												alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE; -							if (mode == LLMaterial::DIFFUSE_ALPHA_MODE_MASK && te->getColor().mV[3] >= 0.999f) +							if (alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_MASK && te->getColor().mV[3] >= 0.999f)  							{  								pool->addRiggedFace(facep, fullbright ? LLDrawPoolAvatar::RIGGED_FULLBRIGHT : LLDrawPoolAvatar::RIGGED_SIMPLE);  							} @@ -5065,9 +4984,9 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)  							if (LLPipeline::sRenderDeferred && te->getMaterialParams().notNull()  && !te->getMaterialID().isNull())  							{  								LLMaterial* mat = te->getMaterialParams().get(); -								if (mat->getNormalID().notNull()) +								if (mat->getNormalID().notNull() && !mat->isNormalInvalid())  								{ -									if (mat->getSpecularID().notNull()) +									if (mat->getSpecularID().notNull() && !mat->isSpecularInvalid())  									{ //has normal and specular maps (needs texcoord1, texcoord2, and tangent)  										if (normspec_count < MAX_FACE_COUNT)  										{ @@ -5082,7 +5001,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)  										}  									}  								} -								else if (mat->getSpecularID().notNull()) +								else if (mat->getSpecularID().notNull() && !mat->isSpecularInvalid())  								{ //has specular map but no normal map, needs texcoord2  									if (spec_count < MAX_FACE_COUNT)  									{ @@ -5739,13 +5658,14 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac  			BOOL is_alpha = (facep->getPoolType() == LLDrawPool::POOL_ALPHA) ? TRUE : FALSE;  			LLMaterial* mat = te->getMaterialParams().get(); - +			U8 diffuse_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE;  			bool can_be_shiny = true; +  			if (mat)  			{ -				U8 mode = mat->getDiffuseAlphaMode(); -				can_be_shiny = mode == LLMaterial::DIFFUSE_ALPHA_MODE_NONE || -								mode == LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE; +				diffuse_mode = mat->isDiffuseAlphaInvalid() ? LLMaterial::DIFFUSE_ALPHA_MODE_NONE : mat->getDiffuseAlphaMode(); +				can_be_shiny = diffuse_mode == LLMaterial::DIFFUSE_ALPHA_MODE_NONE || +						diffuse_mode == LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE;  			}  			bool use_legacy_bump = te->getBumpmap() && (te->getBumpmap() < 18) && (!mat || mat->getNormalID().isNull()); @@ -5761,7 +5681,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac  				//  				if (te->getFullbright())  				{ -					if (mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK) +					if (diffuse_mode == LLMaterial::DIFFUSE_ALPHA_MODE_MASK)  					{  						if (opaque)  						{ @@ -5840,7 +5760,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac  			}  			else if (mat)  			{ -				U8 mode = mat->getDiffuseAlphaMode(); +				U8 mode = diffuse_mode;  				if (te->getColor().mV[3] < 0.999f)  				{  					mode = LLMaterial::DIFFUSE_ALPHA_MODE_BLEND; @@ -5936,7 +5856,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac  				}  				else if (fullbright || bake_sunlight)  				{ //fullbright -					if (mat && mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK) +					if (mat && diffuse_mode == LLMaterial::DIFFUSE_ALPHA_MODE_MASK)  					{  						registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK);  					} @@ -5958,7 +5878,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac  					else  					{ //all around simple  						llassert(mask & LLVertexBuffer::MAP_NORMAL); -						if (mat && mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK) +						if (mat && diffuse_mode == LLMaterial::DIFFUSE_ALPHA_MODE_MASK)  						{ //material alpha mask can be respected in non-deferred  							registerFace(group, facep, LLRenderPass::PASS_ALPHA_MASK);  						} diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index d3be5fea1a..138d186e06 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1691,7 +1691,7 @@ U32 LLPipeline::getPoolTypeFromTE(const LLTextureEntry* te, LLViewerTexture* ima  		alpha = alpha || (imagep->getComponents() == 4 && imagep->getType() != LLViewerTexture::MEDIA_TEXTURE) || (imagep->getComponents() == 2);  	} -	if (alpha && mat) +	if (alpha && mat && !mat->isDiffuseAlphaInvalid())  	{  		switch (mat->getDiffuseAlphaMode())  		{ @@ -1712,7 +1712,7 @@ U32 LLPipeline::getPoolTypeFromTE(const LLTextureEntry* te, LLViewerTexture* ima  	{  		return LLDrawPool::POOL_ALPHA;  	} -	else if ((te->getBumpmap() || te->getShiny()) && (!mat || mat->getNormalID().isNull())) +	else if ((te->getBumpmap() || te->getShiny()) && (!mat || mat->getNormalID().isNull() || mat->isNormalInvalid()))  	{  		return LLDrawPool::POOL_BUMP;  	} diff --git a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml index dddb258ed9..af6d11f47e 100644 --- a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml +++ b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml @@ -47,7 +47,6 @@       top="20"       width="500">          <panel -         border="none"           height="150"           label="Search"           layout="topleft" @@ -108,7 +107,6 @@            </scroll_list>          </panel>          <panel -         border="none"           height="150"           label="Friends"           layout="topleft" @@ -144,7 +142,6 @@              <scroll_list               follows="all"               height="120" -             border="false"               layout="topleft"               left="0"               name="Friends" @@ -154,7 +151,6 @@          </panel>          <panel -         border="none"           height="150"           label="Near Me"           layout="topleft" @@ -213,7 +209,6 @@               draw_heading="true"               follows="all"               height="100" -             border="false"               layout="topleft"               left="0"               name="NearMe" diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 9af4b299de..c6460c3c72 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -6233,7 +6233,7 @@ The folder '[FOLDERNAME]' is a system folder. Deleting system folders     icon="alertmodal.tga"     name="ConfirmEmptyTrash"     type="alertmodal"> -[COUNT] items will be permanently deleted. Are you sure you want to permanently delete the contents of your Trash? +[COUNT] items and folders will be permanently deleted. Are you sure you want to permanently delete the contents of your Trash?      <tag>confirm</tag>      <usetemplate       name="okcancelbuttons" diff --git a/indra/newview/skins/default/xui/en/panel_notification.xml b/indra/newview/skins/default/xui/en/panel_notification.xml index 4d9316768b..c1a68fb9af 100644 --- a/indra/newview/skins/default/xui/en/panel_notification.xml +++ b/indra/newview/skins/default/xui/en/panel_notification.xml @@ -71,7 +71,6 @@        mouse_opaque="false"        name="text_editor_box"        read_only="true" -      tab_stop="false"        text_color="White"        text_readonly_color="White"        top="10" | 
